Class pmr.euclid.Vector3
All Packages Class Hierarchy This Package Previous Next Index
Class pmr.euclid.Vector3
java.lang.Object

+pmr.euclid.Status

+pmr.euclid.Vector3
 public class Vector3
 extends Status
Vector3  3dimensional vector
A vector has thre components giving it a length and a direction (whose
sign is important),but no position. Vectors are often normalised to
unti length.
Vectors and points are very closely related and some people use them
interchangeabley. A Point3 has a position and cannot be
normlaised. In very many routines, however, Vectors and Points
can either be used interchangeably, or there are equivalent routines
or they can be converted using crossconstructors. (They cannot
be interconverted through casts).
The default vector is 0.0, 0.0, 0.0. Some operations on this will
result in ZerolengthVector Exceptions.
 Author:
 (C) P. MurrayRust, 1996

Vector3()
 null constructor

Vector3(Choice3)
 axial unit vector constructor: unit vectors along X, Y, Z axes

Vector3(double, double, double)
 formed from vector components

Vector3(double[])
 formed from vector components

Vector3(Point3)
 make a vector from a point

Vector3(RealArray)
 copy constructor from RealArray:

Vector3(Vector3)
 copy constructor:

clone(Point3)
 from Point3

clone(Vector3)


cross(Vector3)
 Vector product

dot(double[])
 dot product  protected

dot(Vector3)
 dot product

elementAt(int)
 subscript operator: counts from ZERO

equals(Vector3)
 are two vectors equal lengths?

getAngleMadeWith(Vector3)
 angle between two vectors

getArray()
 get the vector components

getLength()
 return vector length

getScalarTripleProduct(Vector3, Vector3)


getUnitVector()


isIdenticalTo(Vector3)
 are two vectors identical?

isZero()
 is a vector null?

longerThan(Vector3)
 vector length > vector length?

main(String[])
 tests Vector3 routines = new Vector3

multiplyBy(double)
 scalar multiplication v = v*f

negative()


normalise()
 Normalise vector

plus(Vector3)


projectOnto(Vector3)
 projection of this onto v3

setElementAt(int, double)
 subscript operator: counts from ZERO

shallowCopy(Vector3)
 shallowCopy

subtract(Vector3)


toString()


transform(Transform3)
 transform a vector
Vector3
public Vector3()
 null constructor
Vector3
public Vector3(double x,
double y,
double z)
 formed from vector components
Vector3
public Vector3(double array[])
 formed from vector components
Vector3
public Vector3(Choice3 axis)
 axial unit vector constructor: unit vectors along X, Y, Z axes
Vector3
public Vector3(Vector3 v)
 copy constructor:
Vector3
public Vector3(RealArray f)
 copy constructor from RealArray:
Vector3
public Vector3(Point3 p)
 make a vector from a point
shallowCopy
public void shallowCopy(Vector3 v)
 shallowCopy
clone
public Vector3 clone(Vector3 v)
clone
public Vector3 clone(Point3 p)
 from Point3
getArray
public double[] getArray()
 get the vector components
equals
public boolean equals(Vector3 v)
 are two vectors equal lengths?
longerThan
public boolean longerThan(Vector3 v)
 vector length > vector length?
multiplyBy
public Vector3 multiplyBy(double f)
 scalar multiplication v = v*f
plus
public Vector3 plus(Vector3 v3)
subtract
public Vector3 subtract(Vector3 v3)
negative
public Vector3 negative()
elementAt
public double elementAt(int n)
 subscript operator: counts from ZERO
setElementAt
public Vector3 setElementAt(int n,
double f)
 subscript operator: counts from ZERO
isIdenticalTo
public boolean isIdenticalTo(Vector3 v)
 are two vectors identical?
isZero
public boolean isZero()
 is a vector null?
transform
public Vector3 transform(Transform3 t)
 transform a vector
cross
public Vector3 cross(Vector3 v3)
 Vector product
normalise
public Vector3 normalise()
 Normalise vector
getUnitVector
public Vector3 getUnitVector()
getLength
public double getLength()
 return vector length
dot
public double dot(Vector3 v3)
 dot product
dot
protected double dot(double v3[])
 dot product  protected
getAngleMadeWith
public Angle getAngleMadeWith(Vector3 v2) throws ZeroLengthVectorException
 angle between two vectors
 Throws: ZeroLengthVectorException
 v2 or this is zero length
getScalarTripleProduct
public double getScalarTripleProduct(Vector3 v2,
Vector3 v3)
projectOnto
public Vector3 projectOnto(Vector3 v3) throws ZeroLengthVectorException
 projection of this onto v3
 Throws: ZeroLengthVectorException
 v2 or this is zero length
toString
public String toString()
 Overrides:
 toString in class Object
main
public static void main(String args[])
 tests Vector3 routines = new Vector3
All Packages Class Hierarchy This Package Previous Next Index