|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuavsim.flightdynamicsmodel.Vector
public class Vector
Defines a mathematical vector designed to hold either position (as x, y, and z) or attitude (as roll, pitch, and yaw, respectively). For compatibility with the other classes derived from the original source (Physics for Game Developers by David Bourg), the member variables are public and mutable. Eventually they will be protected appropriately. In addition, some methods inconsistently operate in place, while others behave as expected and return a new affected instance of the vector.
| Field Summary | |
|---|---|
double |
_x
the x component, or roll in Euler angles |
double |
_y
the y component, or pitch in Euler angles |
double |
_z
the z component, or yaw in Euler angles |
| Constructor Summary | |
|---|---|
Vector()
Creates an attitude or position vector with zero values. |
|
Vector(Attitude attitude)
Creates an attitude vector from Euler angles. |
|
Vector(CoordinateWorld3D coordinate)
Creates a position vector from a 3D world coordinate. |
|
Vector(double x,
double y,
double z)
Creates an attitude or position vector. |
|
| Method Summary | |
|---|---|
Vector |
add(Vector vector)
Calculates the sum of this vector and another. |
Vector |
clone()
|
Vector |
conjugate()
Calculates the conjugate of this vector. |
Attitude |
convertToAttitude()
Converts this vector to an attitude. |
CoordinateWorld3D |
convertToCoordinateWorld3D()
Converts this vector to 3D world coordinates. |
Vector |
crossProduct(Vector vector)
Calculates the cross product of this vector and another. |
Vector |
divide(double scale)
Calculates the scaled components of this vector. |
Vector |
dotProduct(Vector vector)
Calculates the dot product of this vector and another. |
double |
getX()
Gets the x component, or roll in Euler angles. |
double |
getY()
Gets the y/i> component, or pitch in Euler angles. |
double |
getZ()
Gets the z/i> component, or yaw in Euler angles. |
double |
magnitude()
Calculates the magnitude of this vector. |
Vector |
multiply(double scale)
Calculates the scaled components of this vector. |
double |
multiply(Vector vector)
Calculates the product of this vector and another. |
Vector |
normalize()
Normalizes the components of this vector in place and returns it as well. |
Vector |
reset()
Resets the components of this vector in place and returns it as well. |
Vector |
reverse()
Negates the components of this vector in place and returns it as well. |
Vector |
subtract(Vector vector)
Calculates the difference of this vector and another. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public double _x
public double _y
public double _z
| Constructor Detail |
|---|
public Vector()
public Vector(Attitude attitude)
attitude - - the attitudepublic Vector(CoordinateWorld3D coordinate)
coordinate - - the coordinate
public Vector(double x,
double y,
double z)
x - - the x component, or roll in Euler anglesy - - the y component, or pitch in Euler anglesz - - the y component, or yaw in Euler angles| Method Detail |
|---|
public Vector add(Vector vector)
vector - - the other vector
public Vector clone()
clone in class java.lang.Objectpublic Vector conjugate()
public Attitude convertToAttitude()
public CoordinateWorld3D convertToCoordinateWorld3D()
public Vector crossProduct(Vector vector)
vector - - the other vector
public Vector divide(double scale)
scale - - the scale
public Vector dotProduct(Vector vector)
vector - - the other vector
public double getX()
public double getY()
public double getZ()
public double magnitude()
public Vector multiply(double scale)
scale - - the scale
public double multiply(Vector vector)
vector - - the other vector
public Vector normalize()
public Vector reset()
public Vector reverse()
public Vector subtract(Vector vector)
vector - - the other vector
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||