|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfrog.Accel3D
public class Accel3D
The basic unit FROG works on. Accel3D objects contain a single sampling of a device's accelerometers. They also contain helpful methods to manipulate that data.
| Constructor Summary | |
|---|---|
Accel3D(double x,
double y,
double z)
Creates a new Accel3D containing the given axis values. |
|
| Method Summary | |
|---|---|
void |
add(Accel3D other)
Performs vector addition on this object using another Accel3D object. |
double |
distanceFrom(Accel3D other)
Finds the distance between this Accel3D and another. |
double |
getMagnitude()
Gets the vector magnitude of this Accel3D. |
double |
getX()
Gets acceleration (in G's) of the X axis. |
double |
getY()
Gets acceleration (in G's) of the Y axis. |
double |
getZ()
Gets acceleration (in G's) of the Z axis. |
void |
rescale(double scaleFactor)
Scales the X, Y, and Z values to a given scale value. |
double[] |
toArray()
Returns the Accel3D converted to an array (double[3]). |
String |
toString()
Returns a String representation of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Accel3D(double x,
double y,
double z)
x - the acceleration in the x-direction (in G's)y - the acceleration in the y-direction (in G's)z - the acceleration in the z-direction (in G's)| Method Detail |
|---|
public void add(Accel3D other)
other - another Accel3D to add to this Accel3Dpublic double distanceFrom(Accel3D other)
other - an Accel3D to compare with
public double getMagnitude()
public double getX()
public double getY()
public double getZ()
public void rescale(double scaleFactor)
scaleFactor - amount to scale by; if 1.0, this vector remains
unchangedpublic double[] toArray()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||