com.mot.iden.math
Class Math

java.lang.Object
  extended bycom.mot.iden.math.Math

public final class Math
extends java.lang.Object

THIS API IS A LICENSEE CLOSED CLASS AND IS THEREFORE RESERVED FOR USE BY MOTOROLA SND IT'S LICENSEES

The class Math contains methods for performing basic numeric operations such as the elementary exponential, logarithm, and trigonometric functions.


MOTOROLA and the Stylized M Logo are registered trademarks of Motorola, Inc. Reg. U.S. Pat. & Tm. Off.
© Copyright 2003-2004 Motorola, Inc. All Rights Reserved.

See Also:
Float

Field Summary
static java.lang.String E
          The String value that is closer than any other to e, the base of the natural logarithms.
static java.lang.String PI
          The String value that is closer than any other to pi, the ratio of the circumference of a circle to its diameter.
 
Method Summary
static Float abs(Float x)
          Returns the absolute value of an Float value.
static Float acos(Float x)
          Returns the arc cosine of an angle, in the range of 0.0 through pi.
static Float add(Float x, Float y)
          Returns the floating-point addition of the two specified Float arguments as a new Float object.
static Float asin(Float x)
          Returns the arc sine of an angle, in the range of -pi/2 through pi/2.
static Float atan(Float x)
          Returns the arc tangent of an angle, in the range of -pi/2 through pi/2.
static Float atan2(Float y, Float x)
          Converts rectangular coordinates (xy) to polar (r, theta).
static Float ceil(Float x)
          Returns the smallest integer (represented as a Float) not less than x.
static Float cos(Float x)
          Returns the trigonometric cosine of an angle.
static Float divide(Float x, Float y)
          Returns the floating-point division of the two specified Float arguments as a new Float object.
static Float exp(Float x)
          Returns Euler's number e raised to the power of a Float value.
static Float floor(Float x)
          Returns the largest integer (represented as a double-precision number) not greater than x.
static Float IEEEremainder(Float x, Float y)
          Computes the remainder operation on two arguments as prescribed by the IEEE 754 standard.
static Float log(Float x)
          Returns the natural logarithm (base e) of a double value.
static Float max(Float x, Float y)
          Returns the greater of two Float values.
static Float min(Float x, Float y)
          Returns the smaller of two Float values.
static Float multiply(Float x, Float y)
          Returns the floating-point multiplication of the two specified Float arguments as a new Float object.
static Float pow(Float x, int y)
          Returns the floating-point of the specified Float argument to the power of a positive integer exponent as a new Float object.
static Float round(Float x)
          Returns the Float value,which mathematically equals to the closest integer to the argument.
static Float sin(Float x)
          Returns the trigonometric sine of an angle.
static Float sqrt(Float x)
          Returns the correctly rounded positive square root of a double value.
static Float subtract(Float x, Float y)
          Returns the floating-point subtraction of the two specified Float arguments as a new Float object.
static Float tan(Float x)
          Returns the trigonometric tangent of an angle.
static Float toDegrees(Float angrad)
          Converts an angle measured in radians to an approximately equivalent angle measured in degrees.
static Float toRadians(Float angdeg)
          Converts an angle measured in degrees to an approximately equivalent angle measured in radians.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

E

public static final java.lang.String E
The String value that is closer than any other to e, the base of the natural logarithms.

See Also:
Constant Field Values

PI

public static final java.lang.String PI
The String value that is closer than any other to pi, the ratio of the circumference of a circle to its diameter.

See Also:
Constant Field Values
Method Detail

round

public static final Float round(Float x)
Returns the Float value,which mathematically equals to the closest integer to the argument. The result is rounded to an integer by adding 1/2, taking the floor of the result.

Special cases:

Parameters:
x - a floating-point value to be rounded to a Float.
Returns:
the value of the argument rounded to the nearest floating-point value that equals to a mathematical integer.
Throws:
java.lang.IllegalArgumentException - if operand is null

pow

public static final Float pow(Float x,
                              int y)
Returns the floating-point of the specified Float argument to the power of a positive integer exponent as a new Float object.

Special cases:

Returns:
the argument to the power of exponent as a new Float object.

Throws:
java.lang.ArithmeticException - if the exponent represents a negative number.
java.lang.IllegalArgumentException - if operand is null

sqrt

public static final Float sqrt(Float x)
Returns the correctly rounded positive square root of a double value.

Special cases:

Parameters:
x - a value.

Returns:
the positive square root of value.

Throws:
java.lang.IllegalArgumentException - if operand is null.
java.lang.ArithmeticException - if the argument x represents a negative number.

add

public static final Float add(Float x,
                              Float y)
Returns the floating-point addition of the two specified Float arguments as a new Float object.

Parameters:
x - A Float containing a floating-point number.
y - A Float containing a floating-point number.
Returns:
the addition of the two arguments as a new Float object.
Throws:
java.lang.IllegalArgumentException - if any operand is null

subtract

public static final Float subtract(Float x,
                                   Float y)
Returns the floating-point subtraction of the two specified Float arguments as a new Float object.

Parameters:
x - A Float containing a floating-point number.
y - A Float containing a floating-point number.
Returns:
the subtraction of the two arguments as a new Float object.
Throws:
java.lang.IllegalArgumentException - if any operand is null

multiply

public static final Float multiply(Float x,
                                   Float y)
Returns the floating-point multiplication of the two specified Float arguments as a new Float object.

Parameters:
x - A Float containing a floating-point number.
y - A Float containing a floating-point number.
Returns:
the multiplication of the two arguments as a new Float object.
Throws:
java.lang.IllegalArgumentException - if any operand is null

divide

public static final Float divide(Float x,
                                 Float y)
                          throws java.lang.ArithmeticException
Returns the floating-point division of the two specified Float arguments as a new Float object.

Parameters:
x - A Float containing a floating-point number.
y - A Float containing a floating-point number.
Returns:
the division of the two arguments as a new Float object.
Throws:
java.lang.IllegalArgumentException - if any operand is null
java.lang.ArithmeticException

sin

public static final Float sin(Float x)
Returns the trigonometric sine of an angle.

Special cases:

Parameters:
x - an angle, in radians.
Returns:
the sine of the argument.
Throws:
java.lang.IllegalArgumentException - if any operand is null

cos

public static final Float cos(Float x)
Returns the trigonometric cosine of an angle.

Special cases:

Parameters:
x - an angle, in radians.
Returns:
the cosine of the argument.

tan

public static final Float tan(Float x)
Returns the trigonometric tangent of an angle.

Special cases:

Parameters:
x - an angle, in radians.
Returns:
the tangent of the argument.
Throws:
java.lang.IllegalArgumentException - if any operand is null

asin

public static final Float asin(Float x)
Returns the arc sine of an angle, in the range of -pi/2 through pi/2.

Special cases:

Parameters:
x - the value whose arc sine is to be returned.
Returns:
the arc sine of the argument.
Throws:
java.lang.IllegalArgumentException - if any operand is null or magnitude of x is greater than one.

acos

public static final Float acos(Float x)
Returns the arc cosine of an angle, in the range of 0.0 through pi.

Spcial cases:

Parameters:
x - the value whose arc cosine is to be returned.
Returns:
the arc cosine of the argument.
Throws:
java.lang.IllegalArgumentException - if any operand is null or magnitude of x is greater than one.

atan

public static final Float atan(Float x)
Returns the arc tangent of an angle, in the range of -pi/2 through pi/2.

Special cases:

Returns:
the arc tangent of the argument.
Throws:
java.lang.IllegalArgumentException - if any operand is null.

toRadians

public static final Float toRadians(Float angdeg)
Converts an angle measured in degrees to an approximately equivalent angle measured in radians. The conversion from degrees to radians is generally inexact.

Parameters:
angdeg - an angle, in degrees
Returns:
the measurement of the angle angdeg in radians.
Throws:
java.lang.IllegalArgumentException - if any operand is null.

toDegrees

public static final Float toDegrees(Float angrad)
Converts an angle measured in radians to an approximately equivalent angle measured in degrees. The conversion from radians to degrees is generally inexact.

Parameters:
angrad - an angle, in radians
Returns:
the measurement of the angle angrad in degrees.
Throws:
java.lang.IllegalArgumentException - if any operand is null.

exp

public static final Float exp(Float x)
Returns Euler's number e raised to the power of a Float value.

Special cases:

Parameters:
x - the exponent to raise e to.
Returns:
the value ea, where e is the base of the natural logarithms.
Throws:
java.lang.IllegalArgumentException - if any operand is null.

log

public static final Float log(Float x)
Returns the natural logarithm (base e) of a double value. Special cases:

Special cases:

Parameters:
x - a number greater than 0.0.
Returns:
the value ln a, the natural logarithm of a.
Throws:
java.lang.IllegalArgumentException - if any operand is null or x less than zero.

IEEEremainder

public static final Float IEEEremainder(Float x,
                                        Float y)
Computes the remainder operation on two arguments as prescribed by the IEEE 754 standard.

Special cases:

Parameters:
x - the dividend.
y - the divisor.
Returns:
the remainder when x is divided by y.
Throws:
java.lang.IllegalArgumentException - if any operand is null.

ceil

public static final Float ceil(Float x)
Returns the smallest integer (represented as a Float) not less than x.

Special cases:

Parameters:
x - a value.
Returns:
the smallest (closest to negative infinity) floating-point value that is not less than the argument and is equal to a mathematical integer.
Throws:
java.lang.IllegalArgumentException - if any operand is null.

floor

public static final Float floor(Float x)
Returns the largest integer (represented as a double-precision number) not greater than x.

Special cases:

Parameters:
x - a value.
Returns:
the largest (closest to positive infinity) floating-point value that is not greater than the argument and is equal to a mathematical integer.
Throws:
java.lang.IllegalArgumentException - if any operand is null.

atan2

public static final Float atan2(Float y,
                                Float x)
Converts rectangular coordinates (xy) 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 (rtheta) in polar coordinates that corresponds to the point (xy) in Cartesian coordinates.
Throws:
java.lang.IllegalArgumentException - if any operand is null.

abs

public static final Float abs(Float x)
Returns the absolute value of an Float value. If the argument is not negative, the argument is returned. If the argument is negative, the negation of the argument is returned.

Parameters:
x - the argument whose absolute value is to be determined
Returns:
the absolute value of the argument.
Throws:
java.lang.IllegalArgumentException - if any operand is null.

max

public static final Float max(Float x,
                              Float y)
Returns the greater of two Float values. That is, the result is the argument closer to positive infinity. If the arguments have the same value, the result is that same value. If either value is NaN, then the result is NaN. Unlike the the numerical comparison operators, this method considers negative zero to be strictly smaller than positive zero. If one argument is positive zero and the other negative zero, the result is positive zero.

Parameters:
x - an argument.
y - another argument.
Returns:
the larger of a and b.
Throws:
java.lang.IllegalArgumentException - if any operand is null.

min

public static final Float min(Float x,
                              Float y)
Returns the smaller of two Float values. That is, the result is the value closer to negative infinity. If the arguments have the same value, the result is that same value. If either value is NaN, then the result is NaN. Unlike the the numerical comparison operators, this method considers negative zero to be strictly smaller than positive zero. If one argument is positive zero and the other is negative zero, the result is negative zero.

Parameters:
x - an argument.
y - another argument.
Returns:
the smaller of a and b.
Throws:
java.lang.IllegalArgumentException - if any operand is null.