com.azalient.apo.basics
Class XyzFinal

java.lang.Object
  extended by com.azalient.apo.basics.XyzFinal
All Implemented Interfaces:
IXy, IXyz, OpenGLXyz, Serializable

public final class XyzFinal
extends Object
implements IXyz

An immutable variant of Xyz which throws an UnsupportedOperationException if an attempt is made to change its value

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.azalient.api.a.position.IXyz
ZERO_ARRAY
 
Constructor Summary
XyzFinal(double x, double y, double z)
           
XyzFinal(IXyz a)
           
 
Method Summary
 void abZ(IXyz a, IXyz b)
          Adjust the height of this point to be on the plane that connects A and B such that a line drawn perpendicular to AB in the plane has constant Z
 void add(IXyz v)
          Vector add operation in place.
 IAngle angleBetween(IXyz v)
          Returns the UNSIGNED angle between this vector and the vector parameter; the return value is constrained to the range [0,180]
 IAngle asBearing()
          Return bearing CW from N in the range [0, 2PI)
 double[] asDouble3()
          Returns this point/vector as an array of 3 doubles
 double asGradient()
          Return the fractional gradient component of this vector
 boolean atZERO()
          Returns true if this point is at the origin (all zeroes)
 IAngle bearingTo(IXyz there)
          Return bearing CW from N in the range [0, 2PI)
 IXyz copy()
          Return a new object as a copy of this point/vector
 IXyz cross(IXyz v)
          Return new vector result of cross with v, original vectors unchanged.
 void crossWith(IXyz v)
          Vector cross operation in place.
 double distance(IXy there)
          distance between here and there
 double distance(IXyz there)
           
 double distance(IXyz a, IXyz b, boolean limitAB)
          return the distance from "this" to line segment AB
 void divide(double s)
          Scalar divide, in place
 IXyz dividedBy(double s)
          Divide all components of Vector by given scalar, returning new vector, originals unchanged.
 double dot(IXyz v)
          Computes the dot product of this vector and vector V.
 void eq(char op, double s)
           
 void eq(char op, IXyz v)
           
 double gradientToFrac(IXyz there)
          Fractional gradient as dh/XY
 boolean isFinite()
          Test if all components are finite and numbers (not NaN)
 double length()
          Returns the length of this vector (or the distance of the point from the origin).
 double lengthSquared()
           
 IXyz minus(IXyz v)
          Vector minus, returning new vector, originals unchanged.
 IXyz multipliedBy(double s)
          Multiply all components of Vector by given scalar, returning new vector, originals unchanged.
 void multiply(double s)
          Scalar multiply, in place
 IXyz nearestPointOn(IXyz a, IXyz b, boolean limitAB)
          return the nearest point to "this" on line segment AB.
 IXyz nearestPointOnLine(IXyz a, IXyz b)
          Returns the nearest point on line AB to this point.
 void negate()
          Negates the value of this xyz in place.
 IXyz negative()
          Return a negative of this vector, original unchanged
 IXyz normalized()
          Returns normalized version of this vector, original unchanged.
 IXyz parallelComponent(IXyz v)
          Return the component of v that is parallel with this
 double parallelComponentMag(IXyz v)
          Return the magnitude of the component of v that is parallel with this
 IXyz perpComponent(IXyz v)
          Return the component of v that is perpendicular to this
 IXyz plus(IXyz v)
          Vector plus, returning new vector, originals unchanged.
 void rotate(IXya xya)
          Rotate this point in the XY-plane around the axis of rotation (x,y) by angle a.
 void rotate(IXy xy, IAngle a)
          Rotate this point in the XY-plane around the axis of rotation (x,y) by angle a.
 IXyz rotationAsMove(IXya xya)
          Convert the given XY-plane rotation around an XY-axis into a translation
 IXyz rotationAsMove(IXy xy, IAngle a)
          Convert the given XY-plane rotation around an XY-axis into a translation
 void scale(double s)
          Scalar multiply, in place
 IXyz selfNormalize()
          Normalizes this vector in place, and returns itself.
 void set(double px, double py, double pz)
          Set this point/vector to the given values
 void set(IXyz xyz)
          Set this point/vector to have the same values as that one (copy by value, not by reference)
 void subtract(IXyz v)
          Vector subtract operation in place.
 boolean toRightOf(IXyz pA, IXyz pB)
          Is point to right of line AB
 String toString()
           
 IXyz transform(IXyz origin0, IAngle compass0, IXyz origin1, IAngle compass1)
           
 IXyz truncateLength(double maxLength)
          Clip to a given length, returning a new object if modification is required
 double v(int i)
          indexed access to components:
i=0 -> X
i=1 -> Y
i=2 -> Z
 void v(int i, double v)
          indexed access to components:
i=0 -> X
i=1 -> Y
i=2 -> Z
 double x()
          X-coordinate of this point
 void x(double value)
          Set the X-coordinate of this point
 double y()
          Y-coordinate of this point
 void y(double value)
          Set the Y-coordinate of this point
 double z()
          Z-coordinate of this point
 void z(double value)
          Set the Z-coordinate of this point
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XyzFinal

public XyzFinal(double x,
                double y,
                double z)

XyzFinal

public XyzFinal(IXyz a)
Method Detail

copy

public final IXyz copy()
Description copied from interface: IXyz
Return a new object as a copy of this point/vector

Specified by:
copy in interface IXyz

angleBetween

public final IAngle angleBetween(IXyz v)
Description copied from interface: IXyz
Returns the UNSIGNED angle between this vector and the vector parameter; the return value is constrained to the range [0,180]

Specified by:
angleBetween in interface IXyz
Parameters:
v - the other vector
Returns:
the angle in the range [0,180]

asBearing

public final IAngle asBearing()
Description copied from interface: IXyz
Return bearing CW from N in the range [0, 2PI)

Specified by:
asBearing in interface IXyz

asGradient

public final double asGradient()
Description copied from interface: IXyz
Return the fractional gradient component of this vector

Specified by:
asGradient in interface IXyz

atZERO

public final boolean atZERO()
Description copied from interface: IXyz
Returns true if this point is at the origin (all zeroes)

Specified by:
atZERO in interface IXyz

bearingTo

public final IAngle bearingTo(IXyz there)
Description copied from interface: IXyz
Return bearing CW from N in the range [0, 2PI)

Specified by:
bearingTo in interface IXyz

cross

public final IXyz cross(IXyz v)
Description copied from interface: IXyz
Return new vector result of cross with v, original vectors unchanged.

Specified by:
cross in interface IXyz

distance

public final double distance(IXyz there)
Specified by:
distance in interface IXyz

distance

public final double distance(IXy there)
Description copied from interface: IXy
distance between here and there

Specified by:
distance in interface IXy

distance

public final double distance(IXyz a,
                             IXyz b,
                             boolean limitAB)
Description copied from interface: IXyz
return the distance from "this" to line segment AB

Specified by:
distance in interface IXyz
limitAB - if true, the distance is to a point between A and B, inclusive. If false, the line is extended to infinite length

dividedBy

public final IXyz dividedBy(double s)
Description copied from interface: IXyz
Divide all components of Vector by given scalar, returning new vector, originals unchanged.

Specified by:
dividedBy in interface IXyz

dot

public final double dot(IXyz v)
Description copied from interface: IXyz
Computes the dot product of this vector and vector V. The dot product is a scalar value that varies as a cosine curve with the angle between the vectors. The dot product of a vector with itself is simply the square of its length. The dot product is

gradientToFrac

public final double gradientToFrac(IXyz there)
Description copied from interface: IXyz
Fractional gradient as dh/XY

Specified by:
gradientToFrac in interface IXyz

isFinite

public final boolean isFinite()
Description copied from interface: IXyz
Test if all components are finite and numbers (not NaN)

Specified by:
isFinite in interface IXyz

length

public final double length()
Description copied from interface: IXyz
Returns the length of this vector (or the distance of the point from the origin). This value is cached.

Specified by:
length in interface IXyz

lengthSquared

public final double lengthSquared()
Specified by:
lengthSquared in interface IXyz

minus

public final IXyz minus(IXyz v)
Description copied from interface: IXyz
Vector minus, returning new vector, originals unchanged.

Specified by:
minus in interface IXyz

multipliedBy

public final IXyz multipliedBy(double s)
Description copied from interface: IXyz
Multiply all components of Vector by given scalar, returning new vector, originals unchanged.

Specified by:
multipliedBy in interface IXyz

nearestPointOn

public final IXyz nearestPointOn(IXyz a,
                                 IXyz b,
                                 boolean limitAB)
Description copied from interface: IXyz
return the nearest point to "this" on line segment AB.

Specified by:
nearestPointOn in interface IXyz
limitAB - if true, the point must be between A and B, inclusive

nearestPointOnLine

public final IXyz nearestPointOnLine(IXyz a,
                                     IXyz b)
Description copied from interface: IXyz
Returns the nearest point on line AB to this point.

Specified by:
nearestPointOnLine in interface IXyz

negative

public final IXyz negative()
Description copied from interface: IXyz
Return a negative of this vector, original unchanged

Specified by:
negative in interface IXyz

normalized

public final IXyz normalized()
Description copied from interface: IXyz
Returns normalized version of this vector, original unchanged.

Specified by:
normalized in interface IXyz

parallelComponent

public final IXyz parallelComponent(IXyz v)
Description copied from interface: IXyz
Return the component of v that is parallel with this

Specified by:
parallelComponent in interface IXyz

parallelComponentMag

public final double parallelComponentMag(IXyz v)
Description copied from interface: IXyz
Return the magnitude of the component of v that is parallel with this

Specified by:
parallelComponentMag in interface IXyz

perpComponent

public final IXyz perpComponent(IXyz v)
Description copied from interface: IXyz
Return the component of v that is perpendicular to this

Specified by:
perpComponent in interface IXyz

plus

public final IXyz plus(IXyz v)
Description copied from interface: IXyz
Vector plus, returning new vector, originals unchanged.

Specified by:
plus in interface IXyz

rotationAsMove

public final IXyz rotationAsMove(IXy xy,
                                 IAngle a)
Description copied from interface: IXyz
Convert the given XY-plane rotation around an XY-axis into a translation

Specified by:
rotationAsMove in interface IXyz

rotationAsMove

public final IXyz rotationAsMove(IXya xya)
Description copied from interface: IXyz
Convert the given XY-plane rotation around an XY-axis into a translation

Specified by:
rotationAsMove in interface IXyz

toRightOf

public final boolean toRightOf(IXyz pA,
                               IXyz pB)
Description copied from interface: IXyz
Is point to right of line AB

Specified by:
toRightOf in interface IXyz

transform

public final IXyz transform(IXyz origin0,
                            IAngle compass0,
                            IXyz origin1,
                            IAngle compass1)
Specified by:
transform in interface IXyz

truncateLength

public final IXyz truncateLength(double maxLength)
Description copied from interface: IXyz
Clip to a given length, returning a new object if modification is required

Specified by:
truncateLength in interface IXyz

v

public final double v(int i)
Description copied from interface: IXyz
indexed access to components:
i=0 -> X
i=1 -> Y
i=2 -> Z

Specified by:
v in interface IXyz

x

public final double x()
Description copied from interface: IXyz
X-coordinate of this point

Specified by:
x in interface IXy
Specified by:
x in interface IXyz
Specified by:
x in interface OpenGLXyz

y

public final double y()
Description copied from interface: IXyz
Y-coordinate of this point

Specified by:
y in interface IXy
Specified by:
y in interface IXyz
Specified by:
y in interface OpenGLXyz

z

public final double z()
Description copied from interface: IXyz
Z-coordinate of this point

Specified by:
z in interface IXyz
Specified by:
z in interface OpenGLXyz

asDouble3

public final double[] asDouble3()
Description copied from interface: IXyz
Returns this point/vector as an array of 3 doubles

Specified by:
asDouble3 in interface IXyz

toString

public final String toString()
Overrides:
toString in class Object

abZ

public final void abZ(IXyz a,
                      IXyz b)
Description copied from interface: IXyz
Adjust the height of this point to be on the plane that connects A and B such that a line drawn perpendicular to AB in the plane has constant Z

Specified by:
abZ in interface IXyz

add

public final void add(IXyz v)
Description copied from interface: IXyz
Vector add operation in place.

Specified by:
add in interface IXyz

crossWith

public final void crossWith(IXyz v)
Description copied from interface: IXyz
Vector cross operation in place.

Specified by:
crossWith in interface IXyz

divide

public final void divide(double s)
Description copied from interface: IXyz
Scalar divide, in place

Specified by:
divide in interface IXyz

eq

public final void eq(char op,
                     IXyz v)

eq

public final void eq(char op,
                     double s)

multiply

public final void multiply(double s)
Description copied from interface: IXyz
Scalar multiply, in place

Specified by:
multiply in interface IXyz

negate

public final void negate()
Description copied from interface: IXyz
Negates the value of this xyz in place.

Specified by:
negate in interface IXyz

rotate

public final void rotate(IXy xy,
                         IAngle a)
Description copied from interface: IXyz
Rotate this point in the XY-plane around the axis of rotation (x,y) by angle a. Rotation is in the XY-plane: The z co-ordinate of this point is not affected.

Specified by:
rotate in interface IXyz

rotate

public final void rotate(IXya xya)
Description copied from interface: IXyz
Rotate this point in the XY-plane around the axis of rotation (x,y) by angle a. Rotation is in the XY-plane: The z co-ordinate of this point is not affected.

Specified by:
rotate in interface IXyz

scale

public final void scale(double s)
Description copied from interface: IXyz
Scalar multiply, in place

Specified by:
scale in interface IXyz

selfNormalize

public final IXyz selfNormalize()
Description copied from interface: IXyz
Normalizes this vector in place, and returns itself.

Specified by:
selfNormalize in interface IXyz

set

public final void set(IXyz xyz)
Description copied from interface: IXyz
Set this point/vector to have the same values as that one (copy by value, not by reference)

Specified by:
set in interface IXyz

set

public final void set(double px,
                      double py,
                      double pz)
Description copied from interface: IXyz
Set this point/vector to the given values

Specified by:
set in interface IXyz

subtract

public final void subtract(IXyz v)
Description copied from interface: IXyz
Vector subtract operation in place.

Specified by:
subtract in interface IXyz

v

public final void v(int i,
                    double v)
Description copied from interface: IXyz
indexed access to components:
i=0 -> X
i=1 -> Y
i=2 -> Z

Specified by:
v in interface IXyz

x

public final void x(double value)
Description copied from interface: IXyz
Set the X-coordinate of this point

Specified by:
x in interface IXy
Specified by:
x in interface IXyz

y

public final void y(double value)
Description copied from interface: IXyz
Set the Y-coordinate of this point

Specified by:
y in interface IXy
Specified by:
y in interface IXyz

z

public final void z(double value)
Description copied from interface: IXyz
Set the Z-coordinate of this point

Specified by:
z in interface IXyz