|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcore.math.Vec3
Store and operate on a 3-dimensional vector = < (x, y, z) >. This class stores and operates on a 3-dimensional vector. Methods that begin with a capital letter modify 'this', while methods that begin with a lowercase letter create a new Vec3 to store the result.
Field Summary | |
static Vec3[] |
Cartesian
should not be modified Cartesian array of the cartesian axes |
static Vec3 |
Invalid
should not be modified Invalid = an invalid Vec3 |
static double |
tolerance
should not be modified tolerance the per-component zero-value maximum |
double |
x
x, y, and z are the components of this vector |
static Vec3 |
Xhat
should not be modified Xhat = the unit x-axis |
double |
y
x, y, and z are the components of this vector |
static Vec3 |
Yhat
should not be modified Yhat = the unit x-axis |
double |
z
x, y, and z are the components of this vector |
static Vec3 |
Zero
should not be modified Zero = the zero vector |
static Vec3 |
Zhat
should not be modified Zhat = the unit x-axis |
Constructor Summary | |
Vec3()
Constructs a new Vec3 = (0, 0, 0) |
|
Vec3(double x,
double y,
double z)
Constructs a new Vec3 = (x, y, z) |
|
Vec3(Vec v)
Constructs a new Vec3 = 'v' Requires: 'v' has dimension 3 |
|
Vec3(Vec3 v)
Constructs a new Vec2 = 'v' |
Method Summary | |
Vec3 |
add(double x,
double y,
double z)
Returns: a new Vec3 that is the sum of 'this' and (x, y, z) |
Vec3 |
Add(double x,
double y,
double z)
Adds (x, y, z) to 'this' Returns: resulting 'this' |
Vec3 |
add(Vec3 v)
Returns: a new Vec3 that is the sum of 'this' and 'v' |
Vec3 |
Add(Vec3 v)
Adds 'v' to 'this' Returns: resulting 'this' |
Vec3 |
addscaled(double x,
double y,
double z,
double s)
Returns: a new Vecc3 that is the sum of 'this' and 's * (x, y, z)' |
Vec3 |
AddScaled(double x,
double y,
double z,
double s)
Adds 's * (x, y, z)' to 'this' Returns: resulting 'this' |
Vec3 |
addscaled(Vec3 v,
double s)
Returns: a new Vec3 that is the sum of 'this' and 's*v' |
Vec3 |
AddScaled(Vec3 v,
double s)
Adds 's*v' to 'this' Returns: resulting 'this' |
Vec3 |
copy()
Returns a copy of 'this' |
Vec3 |
cross(Vec3 b)
Returns: a new Vec3 that is the cross product of 'this' and 'b' |
Vec3 |
Cross(Vec3 b)
Sets 'this' to be the cross product of 'this' and 'b' Returns: resulting 'this' |
Vec3 |
Cross(Vec3 a,
Vec3 b)
Sets 'this' to be the cross product of 'a' and 'b' Returns: resulting 'this' |
double |
dot(double x,
double y,
double z)
Returns: the dot product of 'this' and (x, y, z) |
double |
dot(Vec3 v)
Returns: the dot product of 'this' and 'v' |
boolean |
equals(Vec3 v)
Returns: true if 'this' equals 'v', false otherwise |
Vec3 |
getNew()
Returns a new Vec2 = (0, 0, 0) |
boolean |
isZero()
Returns: true if 'this' is zero, false otherwise |
double |
len()
Returns: the magnitude of 'this' |
double |
len2()
Returns: the magnitude squared of 'this' |
double |
len3()
Returns: the magnitude cubed of 'this' |
Vec3 |
neg()
Returns: a new Vec3 that is the opposite of 'this' |
Vec3 |
Neg()
Negates 'this' Returns: resulting 'this' |
Vec3 |
para(Vec3 d)
Returns: a new Vec3 that is the component of 'this' parallel to 'd' Requires: 'd' is not zero |
Vec3 |
Para(Vec3 d)
Isolates the component of 'this' parallel to 'd' Returns: resulting 'this' Requires: 'd' is not zero |
Vec3 |
paraunit(Vec3 d)
Returns: a new Vec3 that is the component of 'this' parallel to 'd' Requires: 'd' has unit magnitude |
Vec3 |
ParaUnit(Vec3 d)
Isolates the component of 'this' parallel to 'd' Returns: resulting 'this' Requires: 'd' has unit magnitude |
Vec3 |
perp(Vec3 d)
Returns: a new Vec2 that is the component of 'this' perpendicular to 'd' Requires: 'd' is not zero |
Vec3 |
Perp(Vec3 d)
Isolates the component of 'this' perpendicular to 'd' Returns: resulting 'this' Requires: 'd' is not zero |
Vec3 |
perpunit(Vec3 d)
Returns: a new Vec3 that is the component of 'this' perpendicular to 'd' Requires: 'd' has unit magnitude |
Vec3 |
PerpUnit(Vec3 d)
Isolates the component of 'this' perpendicular to 'd' Returns: resulting 'this' Requires: 'd' has unit magnitude |
Vec3 |
scale(double s)
Returns: a new Vec3 that is 's*this' |
Vec3 |
Scale(double s)
Scales 'this' by 's' Returns: resulting 'this' |
Vec3 |
scale(Vec3 v)
Returns: a new Vec3 that is 'this' with its components scaled by 'v' |
Vec3 |
Scale(Vec3 v)
Scales each component of 'this' by the corresponding component of 'v' Returns: resulting 'this' |
Vec3 |
Set(double x,
double y,
double z)
Sets 'this' to (x, y, z) Returns: resulting 'this' |
Vec3 |
Set(Vec v)
Sets 'this' to 'v' Returns: resulting 'this' Requires: 'v' has dimension 3 |
Vec3 |
Set(Vec3 v)
Sets the value of 'this' to that of 'v' Returns: resulting 'this' |
Vec3 |
SetZero()
Sets 'this' to zero Returns: resulting 'this' |
Vec3 |
sub(double x,
double y,
double z)
Returns: a new Vec3 that is the difference between 'this' and (x, y, z) |
Vec3 |
Sub(double x,
double y,
double z)
Subtracts (x, y, z) from 'this' Returns: resulting 'this' |
Vec3 |
sub(Vec3 v)
Returns: a new Vec3 that is the difference between 'this' and 'v' |
Vec3 |
Sub(Vec3 v)
Subtracts 'v' from 'this' Returns: resulting 'this' |
Vec |
toVec()
Returns: a new Vec that is < 3, 'this' > |
javax.vecmath.Vector3d |
toVector3d()
Returns: a new Vector3d that equals 'this' |
javax.vecmath.Vector3f |
toVector3f()
Returns: a new Vector3f that equals 'this' |
Vec3 |
unit()
Returns: a new Vec3 that is 'this' scaled to unit magnitude Requires: 'this' is not zero |
Vec3 |
Unit()
Rescales 'this' to be of unit magnitude Returns: resulting 'this' Requires: 'this' is not zero |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public double x
public double y
public double z
public static Vec3 Zero
public static Vec3 Xhat
public static Vec3 Yhat
public static Vec3 Zhat
public static Vec3[] Cartesian
public static Vec3 Invalid
public static double tolerance
Constructor Detail |
public Vec3()
public Vec3(Vec3 v)
public Vec3(double x, double y, double z)
public Vec3(Vec v)
Method Detail |
public Vec3 getNew()
public Vec3 copy()
public Vec3 Set(Vec3 v)
public Vec3 Set(double x, double y, double z)
public Vec3 Set(Vec v)
public Vec3 SetZero()
public boolean isZero()
public boolean equals(Vec3 v)
public Vec3 Add(Vec3 v)
public Vec3 Add(double x, double y, double z)
public Vec3 add(Vec3 v)
public Vec3 add(double x, double y, double z)
public Vec3 AddScaled(Vec3 v, double s)
public Vec3 AddScaled(double x, double y, double z, double s)
public Vec3 addscaled(Vec3 v, double s)
public Vec3 addscaled(double x, double y, double z, double s)
public Vec3 Sub(Vec3 v)
public Vec3 Sub(double x, double y, double z)
public Vec3 sub(Vec3 v)
public Vec3 sub(double x, double y, double z)
public Vec3 Neg()
public Vec3 neg()
public double dot(Vec3 v)
public double dot(double x, double y, double z)
public double len()
public double len2()
public double len3()
public Vec3 Scale(double s)
public Vec3 scale(double s)
public Vec3 Scale(Vec3 v)
public Vec3 scale(Vec3 v)
public Vec3 Unit()
public Vec3 unit()
public Vec3 Cross(Vec3 b)
public Vec3 Cross(Vec3 a, Vec3 b)
public Vec3 cross(Vec3 b)
public Vec3 Para(Vec3 d)
public Vec3 para(Vec3 d)
public Vec3 ParaUnit(Vec3 d)
public Vec3 paraunit(Vec3 d)
public Vec3 Perp(Vec3 d)
public Vec3 perp(Vec3 d)
public Vec3 PerpUnit(Vec3 d)
public Vec3 perpunit(Vec3 d)
public Vec toVec()
public javax.vecmath.Vector3d toVector3d()
public javax.vecmath.Vector3f toVector3f()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |