SunSPOT API V3.0


com.sun.squawk.util
Class MathUtils

java.lang.Object
  extended by com.sun.squawk.util.MathUtils

public class MathUtils
extends Object

The class MathUtils contains some of the Java SE Math routines that are not present in the CLDC 1.1 version of Math:

asin(double), acos(double), atan(double) & atan2(double, double).

The methods in this class are directly substitutable for the corresponding methods in Java SE java.lang.Math.

See Also:
java.lang.Math in Java SE, CLDC 1.1's java.lang.Math

Method Summary
static double acos(double a)
          Returns the arc cosine of an angle, in the range of 0 through pi.
static double asin(double a)
          Returns the arc sine of an angle, in the range of -pi/2 through pi/2.
static double atan(double a)
          Returns the arc tangent of an angle, in the range of -pi/2 through pi/2.
static double atan2(double y, double x)
          Converts rectangular coordinates (x, y) to polar (r, theta).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

acos

public static double acos(double a)
Returns the arc cosine of an angle, in the range of 0 through pi. Special cases:

Parameters:
a - the value whose arc cosine is to be returned.
Returns:
the arc cosine of the argument.

asin

public static double asin(double a)
Returns the arc sine of an angle, in the range of -pi/2 through pi/2. Special cases:

Parameters:
a - the value whose arc sine is to be returned.
Returns:
the arc sine of the argument.

atan

public static double atan(double a)
Returns the arc tangent of an angle, in the range of -pi/2 through pi/2. Special cases:

Parameters:
a - the value whose arc tangent is to be returned.
Returns:
the arc tangent of the argument.

atan2

public static double atan2(double y,
                           double x)
Converts rectangular coordinates (x, y) to polar (r, theta). This method computes the phase theta by computing an arc tangent of y/x in the range of -pi to pi. Special cases:

Parameters:
y - the ordinate coordinate
x - the abscissa coordinate
Returns:
the theta component of the point (r, theta) in polar coordinates that corresponds to the point (x, y) in Cartesian coordinates.

SunSPOT API V3.0


Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.