com.motorola.iden.micro3d
Class Utility

java.lang.Object
  |
  +--com.motorola.iden.micro3d.Utility

public final class Utility
extends java.lang.Object

The Utility class contains methods for performing miscellaneous math operations such as sine, cosine, and square root. In addition, a method is provided for obtaining the version of the Micro3D engine. The implementation for these methods is provided by the Micro3D engine.


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.


Method Summary
static int cos(int angle)
          Obtains the cosine approximation of the specified angle.
static java.lang.String getVersion()
          Returns the version of the Micro3D engine.
static int sin(int angle)
          Obtains the sine approximation of the specified angle.
static int squareRoot(int x)
          Obtains a square root approximation of the specified value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

squareRoot

public static int squareRoot(int x)
                      throws java.lang.IllegalArgumentException
Obtains a square root approximation of the specified value. The specifed value must be greater than or equal to 0. The result is rounded to the nearest integer value.

Parameters:
x - the value to calculate the square root of.
Returns:
the approximate square root value.
Throws:
java.lang.IllegalArgumentException - if the specified value is less than 0.

sin

public static int sin(int angle)
Obtains the sine approximation of the specified angle. For the angle parameter, a value of 4096 is equivalent to 360 degrees. The return value of this method is the sine multiplied by 4096.

Parameters:
angle - the value to calculate the sine of.
Returns:
the approximation to sine multiplied by 4096.

cos

public static int cos(int angle)
Obtains the cosine approximation of the specified angle. For the angle parameter, a value of 4096 is equivalent to 360 degrees. The return value of this method is the cosine multiplied by 4096.

Parameters:
angle - the value to calculate the cosine of.
Returns:
the approximation to cosine multiplied by 4096.

getVersion

public static java.lang.String getVersion()
Returns the version of the Micro3D engine. The return value is a String object containing the version number of the engine.

Returns:
a String representing the version number of the engine.