|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.naokishibata.math.Vector3D
public class Vector3D
Vector3D is an immutable class representing a 3-dimensional vector.
Field Summary | |
---|---|
double |
x
The first coordinate. |
double |
y
The second coordinate. |
double |
z
The third coordinate. |
Constructor Summary | |
---|---|
Vector3D(double x0,
double y0,
double z0)
Constructs a new Vector3D instance which represents (x0, y0, z0) vector. |
Method Summary | |
---|---|
static Vector3D |
add(Vector3D v,
Vector3D u)
Returns the addition of vectors v and u. |
static Vector3D |
add(Vector3D v,
Vector3D u,
Vector3D w)
Returns the addition of vectors v, u and w. |
static Vector3D |
add(Vector3D v,
Vector3D u,
Vector3D w,
Vector3D x)
Returns the addition of vectors v, u, w and x. |
static double |
angle(Vector3D v,
Vector3D w)
Returns the angle of vector v and w |
static Vector3D |
centroid(java.lang.Iterable<? extends Vector3D> c)
Returns the centroid of collection c of vectors |
static Vector3D |
centroid(Vector3D v,
Vector3D w)
Returns the centroid of v and w |
static Vector3D |
centroid(Vector3D v,
Vector3D w,
Vector3D x)
Returns the centroid of v, w and x |
static Vector3D |
centroid(Vector3D v,
Vector3D w,
Vector3D x,
Vector3D y)
Returns the centroid of v, w, x and y |
int |
compareTo(java.lang.Object o)
|
Vector3D |
cross(Vector3D v)
Returns the cross product of this and v |
static Vector3D |
crossProduct(Vector3D v1,
Vector3D v2)
Returns the cross product of vectors v and u. |
static double |
distance(Vector3D v,
Vector3D w)
Returns the distance between v and w |
static double |
distanceSquared(Vector3D v,
Vector3D w)
Returns the squared distance between v and w |
Vector3D |
dot(double d)
Returns this vector scaled by d |
double |
dot(Vector3D v)
Returns the dot product of this and v |
static double |
dotProduct(Vector3D v,
Vector3D u)
Returns the dot product of vectors v and u. |
boolean |
epsilonEquals(Vector3D v)
|
boolean |
epsilonEquals(Vector3D v,
double eps)
|
static boolean |
epsilonEquals(Vector3D v,
Vector3D w)
|
static boolean |
epsilonEquals(Vector3D v,
Vector3D w,
double eps)
|
boolean |
equals(java.lang.Object o)
|
boolean |
equals(Vector3D v)
|
static boolean |
equals(Vector3D v,
Vector3D w)
|
int |
hashCode()
Returns hash code of this instance |
static int |
hashCode(Vector3D v)
|
double |
length()
Returns the length of this vector |
static double |
length(Vector3D v)
Returns the length of vector v |
double |
lengthSquared()
Returns the squared length of this vector |
static double |
lengthSquared(Vector3D v)
Returns the squared length of vector v |
static Vector3D |
midpoint(Vector3D v,
Vector3D w)
Returns the midpoint between v and w |
Vector3D |
minus(Vector3D v)
Returns this - v |
static Vector3D |
normalize(Vector3D v)
Returns the normalized vector of v. |
Vector3D |
normalized()
|
Vector3D |
plus(Vector3D v)
Returns this + v |
Vector3D |
rotX(double rx,
double bx,
double by,
double bz)
Returns the vector rotated on x-axis around (bx, by, bz) |
Vector3D |
rotX(double r,
Vector3D b)
Returns the vector rotated on x-axis around b |
static Vector3D |
rotX(Vector3D v,
double rx,
double bx,
double by,
double bz)
Returns vector v rotated on x-axis around (bx, by, bz) |
static Vector3D |
rotX(Vector3D v,
double r,
Vector3D b)
Returns vector v rotated on x-axis around b |
Vector3D |
rotY(double rx,
double bx,
double by,
double bz)
Returns the vector rotated on y-axis around (bx, by, bz) |
Vector3D |
rotY(double r,
Vector3D b)
Returns the vector rotated on y-axis around b |
static Vector3D |
rotY(Vector3D v,
double ry,
double bx,
double by,
double bz)
Returns vector v rotated on y-axis around (bx, by, bz) |
static Vector3D |
rotY(Vector3D v,
double r,
Vector3D b)
Returns vector v rotated on y-axis around b |
Vector3D |
rotZ(double rx,
double bx,
double by,
double bz)
Returns the vector rotated on z-axis around (bx, by, bz) |
Vector3D |
rotZ(double r,
Vector3D b)
Returns the vector rotated on z-axis around b |
static Vector3D |
rotZ(Vector3D v,
double rz,
double bx,
double by,
double bz)
Returns vector v rotated on z-axis around (bx, by, bz) |
static Vector3D |
rotZ(Vector3D v,
double r,
Vector3D b)
Returns vector v rotated on z-axis around b |
static Vector3D |
scale(double s,
Vector3D v)
Returns vector v scaled by s |
static Vector3D |
scale(Vector3D v,
double s)
Returns vector v scaled by s |
static Vector3D |
sub(Vector3D v,
Vector3D u)
Returns vector v subtracted u. |
Vector3D |
times(double d)
Returns this vector scaled by d |
float[] |
toFloatArray()
Convert this vector to a float array |
float[] |
toFloatArray(int n)
Convert this vector to a float array of length n |
java.lang.String |
toString()
Returns the string representation of the vector. |
double |
x()
Returns the first coordinate of the vector. |
double |
y()
Returns the second coordinate of the vector. |
double |
z()
Returns the third coordinate of the vector. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final double x
public final double y
public final double z
Constructor Detail |
---|
public Vector3D(double x0, double y0, double z0)
Method Detail |
---|
public double x()
public double y()
public double z()
public java.lang.String toString()
toString
in class java.lang.Object
public static Vector3D add(Vector3D v, Vector3D u)
public static Vector3D add(Vector3D v, Vector3D u, Vector3D w)
public static Vector3D add(Vector3D v, Vector3D u, Vector3D w, Vector3D x)
public static Vector3D sub(Vector3D v, Vector3D u)
public static double dotProduct(Vector3D v, Vector3D u)
public static Vector3D crossProduct(Vector3D v1, Vector3D v2)
public static Vector3D scale(double s, Vector3D v)
public static Vector3D scale(Vector3D v, double s)
public static Vector3D normalize(Vector3D v)
public static double length(Vector3D v)
public static double lengthSquared(Vector3D v)
public static double distance(Vector3D v, Vector3D w)
public static double distanceSquared(Vector3D v, Vector3D w)
public static Vector3D midpoint(Vector3D v, Vector3D w)
public static Vector3D centroid(Vector3D v, Vector3D w)
public static Vector3D centroid(Vector3D v, Vector3D w, Vector3D x)
public static Vector3D centroid(Vector3D v, Vector3D w, Vector3D x, Vector3D y)
public static double angle(Vector3D v, Vector3D w)
public static Vector3D rotX(Vector3D v, double rx, double bx, double by, double bz)
public static Vector3D rotY(Vector3D v, double ry, double bx, double by, double bz)
public static Vector3D rotZ(Vector3D v, double rz, double bx, double by, double bz)
public static Vector3D rotX(Vector3D v, double r, Vector3D b)
public static Vector3D rotY(Vector3D v, double r, Vector3D b)
public static Vector3D rotZ(Vector3D v, double r, Vector3D b)
public Vector3D rotX(double rx, double bx, double by, double bz)
public Vector3D rotY(double rx, double bx, double by, double bz)
public Vector3D rotZ(double rx, double bx, double by, double bz)
public Vector3D rotX(double r, Vector3D b)
public Vector3D rotY(double r, Vector3D b)
public Vector3D rotZ(double r, Vector3D b)
public static boolean epsilonEquals(Vector3D v, Vector3D w, double eps)
public static boolean epsilonEquals(Vector3D v, Vector3D w)
public double length()
public double lengthSquared()
public boolean epsilonEquals(Vector3D v, double eps)
public boolean epsilonEquals(Vector3D v)
public Vector3D plus(Vector3D v)
public Vector3D minus(Vector3D v)
public Vector3D normalized()
public double dot(Vector3D v)
public Vector3D dot(double d)
public Vector3D times(double d)
public Vector3D cross(Vector3D v)
public int hashCode()
hashCode
in class java.lang.Object
public static int hashCode(Vector3D v)
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public boolean equals(Vector3D v)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public static boolean equals(Vector3D v, Vector3D w)
public static Vector3D centroid(java.lang.Iterable<? extends Vector3D> c)
public float[] toFloatArray()
public float[] toFloatArray(int n)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |