|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.vizzini.math.Vector
public class Vector
Provides a vector. Instances of this class are immutable.
Field Summary | |
---|---|
static Vector |
X_AXIS
X axis. |
static Vector |
Y_AXIS
Y axis. |
static Vector |
Z_AXIS
Z axis. |
static Vector |
ZERO
Zero vector. |
Constructor Summary | |
---|---|
Vector()
Construct this object. |
|
Vector(double rightAscension,
double declination)
Construct a unit vector pointing in the direction specified by the given angles. |
|
Vector(double x,
double y,
double z)
Construct this object with the given parameters. |
|
Vector(double t,
Vector v0,
Vector v1)
Construct a vector from v0 to v1 at t. |
Method Summary | |
---|---|
Vector |
add(Vector v)
Return a new Vector which is the sum of this and the given vector.. |
double |
angle(Vector v)
Return the angle between this vector and the given vector, in radians. |
Object |
clone()
Return a clone of this instance. |
Vector |
cross(Vector v)
Return a new vector which is the cross between the given vectors. |
Vector |
cross(Vector v,
boolean force)
Return a new vector which is the cross between this and the given vector. |
Vector |
divide(double m)
Return a new vector divided by the given scalar. |
double |
dot(Vector v)
Return the vector dot product. |
boolean |
equals(Object object)
Return true if this vector equals the given object. |
boolean |
equals(Object object,
double delta)
Return true if this vector equals the given object. |
double |
getDeclination()
Return the declination angle of this vector in radians. |
double |
getMagnitude()
Return the magnitude of this vector. |
double |
getRightAscension()
Return the right ascension angle of this vector in radians. |
double |
getX()
Return the X component. |
double |
getY()
Return the Y component. |
double |
getZ()
Return the Z component. |
int |
hashCode()
Return a hash code. |
Vector |
multiply(double m)
Return a new vector multiplied by the given scalar. |
static Vector |
parseVector(String vectorString)
Parse the given string into a Vector. |
Vector |
subtract(Vector v)
Return a new Vector which is this minus the given vector.. |
String |
toAnglesString()
Return a string representation of this object as right ascension and declination angles.. |
double[] |
toArray()
Return this vector's components as an array. |
String |
toString()
Return a string representation of this object. |
Vector |
unit()
Return a new vector which is a unit vector of this. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Vector ZERO
public static final Vector X_AXIS
public static final Vector Y_AXIS
public static final Vector Z_AXIS
Constructor Detail |
---|
public Vector(double rightAscension, double declination)
rightAscension
- Right ascension angle in radians.declination
- Declination angle in radians.public Vector(double x, double y, double z)
public Vector(double t, Vector v0, Vector v1)
t
- Parameter from v0 to v1.v0
- Start vector.v1
- End vector.public Vector()
Method Detail |
---|
public static Vector parseVector(String vectorString)
public Vector add(Vector v)
public double angle(Vector v)
public Object clone()
clone
in class Object
public Vector cross(Vector v)
public Vector cross(Vector v, boolean force)
v
- Vector with which to cross.force
- Flag indicating whether to force the algorithm to return a
valid vector if this and v are 180 degrees apart.public Vector divide(double m)
public double dot(Vector v)
public boolean equals(Object object)
equals
in class Object
object
- Object to compare.public boolean equals(Object object, double delta)
object
- Object to compare.delta
- Allowable difference in coordinates.public double getDeclination()
public double getMagnitude()
public double getRightAscension()
public double getX()
public double getY()
public double getZ()
public int hashCode()
hashCode
in class Object
public Vector multiply(double m)
public Vector subtract(Vector v)
public String toAnglesString()
public double[] toArray()
public String toString()
toString
in class Object
public Vector unit()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |