|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ProGAL.geomNd.Vector ProGAL.geom3d.Vector
public class Vector
A vector in (x,y,z)-space represented with double precision.
Nested Class Summary | |
---|---|
static class |
Vector.ImmutableVector3d
A wrapper class for Vector3d which makes the vector immutable. |
Field Summary | |
---|---|
static Vector |
X
An immutable vector pointing in the (1,0,0)-direction. |
static Vector |
Y
An immutable vector pointing in the (0,1,0)-direction. |
static Vector |
Z
An immutable vector pointing in the (0,0,1)-direction. |
Constructor Summary | |
---|---|
Vector(double[] coords)
Construct a vector using the double-array as coordinates. |
|
Vector(double x,
double y,
double z)
Construct a vector with the specified coordinates. |
|
Vector(Point p)
Construct a vector pointing from origo to p. |
|
Vector(Point p1,
Point p2)
Constructs a vector between two points p1 and p2 - added by pawel 12-11-2011 |
|
Vector(Vector v)
Construct a vector that is a clone of v. |
Method Summary | |
---|---|
Vector |
add(Point p)
Add p to this vector and return the result (without changing this object). |
Vector |
add(Vector v)
Add v to this vector and return the result (without changing this object). |
Vector |
addThis(Point p)
Add p to this vector and return the result (changing this object). |
Vector |
addThis(Vector v)
Add v to this vector and return the result (changing this object). |
double |
angle(Vector v)
Get the angle between this vector and v. |
Vector |
clone()
Create a clone of this vector. |
Vector |
cross(Vector v)
Get the cross-product of this vector and v (without changing this object). |
Vector |
crossThis(Vector v)
Get the cross-product of this vector and v and store the result in this vector (changes this object). |
Vector |
divide(double s)
Divide this vector by s and return the result (without changing this object). |
Vector |
divideThis(double s)
Divide this vector by s and return the result (changing this object). |
double |
dot(Vector v)
Get the dot-product of this vector and v. |
static double |
getAngle(Vector u,
Vector v)
Get the angle between vector u and v. |
static double |
getCosDihedralAngle(Vector u,
Vector v,
Vector w)
|
static double |
getDihedralAngle(Vector b1,
Vector b2,
Vector b3)
Get the dihedral angle between 3 non-colinear vectors b1, b2, b3. |
Vector |
getOrthonormal()
Get a vector (one of many possible) orthonormal to vector v. |
boolean |
isParallel(Vector v)
|
boolean |
isSteinerAngle(Vector v)
|
Vector |
multiply(double s)
Multiply this vector by s and return the result (without changing this object). |
Vector |
multiplyThis(double s)
Multiply this vector by s and return the result (changing this object). |
Vector |
normalize()
Normalize this vector and return the result (without changing this object). |
Vector |
normalizeFast()
|
Vector |
normalizeThis()
Normalize this vector and return the result (changing this object). |
Vector |
normalizeThisFast()
|
Vector |
rotateIn(Vector v,
double angle)
Perform a right-handed rotation of v around this vector. |
Vector |
scaleToLength(double length)
Scale this vector to a certain length (returns new object and does not change this object). |
Vector |
scaleToLengthThis(double length)
Scale this vector to a certain length (changes this object). |
void |
set(Vector v)
Set all coordinates of this vector equal to those of v |
void |
setX(double x)
Set the first coordinate |
void |
setY(double y)
Set the second coordinate |
void |
setZ(double z)
Set the third coordinate |
Vector |
subtract(Vector v)
Subtract v from this vector and return the result (without changing this object). |
Vector |
subtractThis(Vector v)
Subract v from this vector and return the result (changing this object). |
void |
toConsole()
Writes this vector to System.out . |
void |
toConsole(int dec)
Writes this vector to System.out with dec decimals precision. |
Point |
toPoint()
Convert this vector to a point. |
void |
toScene(J3DScene scene,
java.awt.Color clr,
double width)
|
java.lang.String |
toString()
Returns a string-representation of this vector formatted with two decimals precision. |
java.lang.String |
toString(int dec)
Returns a string-representation of this vector formatted with dec decimals precision. |
double |
x()
Get the first coordinate. |
double |
y()
Get the second coordinate. |
double |
z()
Get the third coordinate. |
Methods inherited from class ProGAL.geomNd.Vector |
---|
add, addThis, angle, dot, equals, equals, get, getCoord, getDimensions, getLengthSquared, isZeroVector, length, outerProduct, set, setCoord, setCoords, subtract, subtractThis |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static Vector X
public static Vector Y
public static Vector Z
Constructor Detail |
---|
public Vector(double x, double y, double z)
public Vector(Point p)
public Vector(Point p1, Point p2)
public Vector(Vector v)
public Vector(double[] coords)
Method Detail |
---|
public double x()
public double y()
public double z()
public void setX(double x)
public void setY(double y)
public void setZ(double z)
public void set(Vector v)
public double dot(Vector v)
public double angle(Vector v)
public Vector add(Vector v)
public Vector addThis(Vector v)
public Vector add(Point p)
public Vector addThis(Point p)
public Vector subtract(Vector v)
public Vector subtractThis(Vector v)
public Vector multiply(double s)
multiply
in class Vector
public Vector multiplyThis(double s)
multiplyThis
in class Vector
public Vector divide(double s)
divide
in class Vector
public Vector divideThis(double s)
divideThis
in class Vector
public Vector normalize()
normalize
in class Vector
public Vector normalizeThis()
normalizeThis
in class Vector
public Vector normalizeFast()
public Vector normalizeThisFast()
public Vector scaleToLength(double length)
scaleToLength
in class Vector
public Vector scaleToLengthThis(double length)
scaleToLengthThis
in class Vector
public Vector cross(Vector v)
public Vector crossThis(Vector v)
public Vector rotateIn(Vector v, double angle)
public Point toPoint()
toPoint
in class Vector
public java.lang.String toString()
toString
in class Vector
public java.lang.String toString(int dec)
dec
decimals precision.
toString
in class Vector
public void toConsole()
System.out
.
toConsole
in class Vector
public void toConsole(int dec)
System.out
with dec
decimals precision.
toConsole
in class Vector
public void toScene(J3DScene scene, java.awt.Color clr, double width)
public Vector clone()
clone
in class Vector
public static double getAngle(Vector u, Vector v)
public static double getDihedralAngle(Vector b1, Vector b2, Vector b3)
public Vector getOrthonormal()
public boolean isParallel(Vector v)
public boolean isSteinerAngle(Vector v)
public static double getCosDihedralAngle(Vector u, Vector v, Vector w)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |