|
JNISpice version 2.0.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectspice.basic.Vector3
public class Vector3
Class Vector3 represents and provides methods implementing mathematical operations on three-dimensional vectors.
Supported operations include:
additionadd(spice.basic.Vector3)
cross productcross(spice.basic.Vector3)
dot productdot(spice.basic.Vector3)
distance between vectorsdist(spice.basic.Vector3)
unitize vectorhat()
test for equality to zeroisZero()
two-vector linear combinationlcom(double a, Vector3 v1, double b, Vector3 v2)
three-vector linear combinationlcom(double a, Vector3 v1, double b, Vector3 v2, double c, Vector3 v3)
vector negationnegate()
vector normnorm()
vector perpendicular componentperp(spice.basic.Vector3)
vector projection onto vectorproj(spice.basic.Vector3)
rotate vector about coordinate axisrotate(int axisIndex, double angle)
rotate vector about vectorrotate(Vector3 axisVector, double angle)
scalar multiplicationscale(double)
angular separationsep(spice.basic.Vector3)
subtractionsub(spice.basic.Vector3)
unitized cross productucross(spice.basic.Vector3)
For methods involving derivatives of functions of 3-dimensional
vectors, such as derivatives of dot products, see the
class Vector6
.
Version 1.0.0 17-NOV-2009 (NJB)
Constructor Summary | |
---|---|
Vector3()
Construct a zero-filled Vector3. |
|
Vector3(double[] vin)
Construct a Vector3 from an array of 3 doubles. |
|
Vector3(double v0,
double v1,
double v2)
Construct a Vector3 from three double scalars. |
|
Vector3(Vector3 vin)
Copy constructor: create a new Vector3 from another. |
Method Summary | |
---|---|
Vector3 |
add(Vector3 v2)
Add two 3 dimensional vectors. |
void |
assign(double[] values)
Assign the contents of an array of three doubles to a Vector3. |
Vector3 |
cross(Vector3 v2)
Compute the cross product of two 3-dimensional vectors. |
double |
dist(Vector3 v1)
Return the distance between two three-dimensional vectors. |
double |
dot(Vector3 v2)
Compute the dot product of two double precision, 3-dimensional vectors. |
double |
getElt(int i)
Return the element of this instance at index [i]. |
Vector3 |
hat()
Find the unit vector along a double precision 3-dimensional vector. |
boolean |
isZero()
Indicate whether a 3-vector is the zero vector. |
static Vector3 |
lcom(double a,
Vector3 v1,
double b,
Vector3 v2)
Compute a vector linear combination of two double precision, 3-dimensional vectors. |
static Vector3 |
lcom(double a,
Vector3 v1,
double b,
Vector3 v2,
double c,
Vector3 v3)
Compute a vector linear combination of three double precision, 3-dimensional vectors. |
Vector3 |
negate()
Negate a double precision 3-dimensional vector. |
double |
norm()
Compute the magnitude of a double precision, 3-dimensional vector. |
Vector3 |
perp(Vector3 v2)
Find the component of this vector orthogonal to a given vector. |
Vector3 |
proj(Vector3 v2)
Find the orthogonal projection of this vector onto a given vector. |
Vector3 |
rotate(int axisIndex,
double angle)
Transform this vector into a basis that is rotated in the counterclockwise sense about a given coordinate axis by a given angle. |
Vector3 |
rotate(Vector3 axisVector,
double angle)
Rotate this vector in the counterclockwise sense about a given vector by a given angle. |
Vector3 |
scale(double s)
Multiply a Vector3 by a scalar. |
double |
sep(Vector3 v2)
Find the separation angle in radians between two double precision, 3-dimensional vectors. |
Vector3 |
sub(Vector3 v2)
Compute the difference between two 3-dimensional, double precision vectors. |
double[] |
toArray()
Return the contents of a Vector3 in an array of 3 doubles. |
java.lang.String |
toString()
Return a string representation of the contents of a Vector3. |
Vector3 |
ucross(Vector3 v2)
Return the unitized cross product of this vector and a given vector. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Vector3()
public Vector3(Vector3 vin)
public Vector3(double[] vin)
public Vector3(double v0, double v1, double v2)
Method Detail |
---|
public void assign(double[] values) throws SpiceException
SpiceException
public Vector3 add(Vector3 v2)
public Vector3 cross(Vector3 v2)
public double dist(Vector3 v1)
public double dot(Vector3 v2)
public double getElt(int i) throws SpiceException
SpiceException
public Vector3 hat()
public boolean isZero()
public static Vector3 lcom(double a, Vector3 v1, double b, Vector3 v2)
public static Vector3 lcom(double a, Vector3 v1, double b, Vector3 v2, double c, Vector3 v3)
public Vector3 negate()
public double norm()
public Vector3 perp(Vector3 v2) throws SpiceException
SpiceException
public Vector3 proj(Vector3 v2) throws SpiceException
SpiceException
public Vector3 rotate(int axisIndex, double angle) throws SpiceException
Equivalently, this method rotates this vector by the negative of the input angle about the indicated axis.
The coordinate axis is identified by an integer:
1 == X axis 2 == Y axis 3 == Z axis
SpiceException
public Vector3 rotate(Vector3 axisVector, double angle) throws SpiceException
SpiceException
public Vector3 scale(double s)
public Vector3 sub(Vector3 v2)
public double sep(Vector3 v2)
public double[] toArray()
public java.lang.String toString()
toString
in class java.lang.Object
public Vector3 ucross(Vector3 v2) throws SpiceException
Return the zero vector if the cross product is zero.
SpiceException
|
JNISpice version 2.0.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |