com.azalient.api.a.position
Interface IXyz

All Superinterfaces:
IXy, OpenGLXyz, Serializable
All Known Subinterfaces:
ILaneLocation, IPosition
All Known Implementing Classes:
Xyz, XyzFinal

public interface IXyz
extends IXy, OpenGLXyz, Serializable

A general-purpose 3-dimensional point or vector object.


Field Summary
static IXyz[] ZERO_ARRAY
           
 
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(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 d)
          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.
 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 d)
          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 that)
          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
 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 interface com.azalient.api.a.position.IXy
distance
 

Field Detail

ZERO_ARRAY

static final IXyz[] ZERO_ARRAY
Method Detail

x

double x()
X-coordinate of this point

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

y

double y()
Y-coordinate of this point

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

z

double z()
Z-coordinate of this point

Specified by:
z in interface OpenGLXyz

x

void x(double value)
Set the X-coordinate of this point

Specified by:
x in interface IXy

y

void y(double value)
Set the Y-coordinate of this point

Specified by:
y in interface IXy

z

void z(double value)
Set the Z-coordinate of this point


length

double length()
Returns the length of this vector (or the distance of the point from the origin). This value is cached.


atZERO

boolean atZERO()
Returns true if this point is at the origin (all zeroes)


copy

IXyz copy()
Return a new object as a copy of this point/vector


set

void set(IXyz that)
Set this point/vector to have the same values as that one (copy by value, not by reference)


set

void set(double px,
         double py,
         double pz)
Set this point/vector to the given values


v

double v(int i)
indexed access to components:
i=0 -> X
i=1 -> Y
i=2 -> Z


v

void v(int i,
       double v)
indexed access to components:
i=0 -> X
i=1 -> Y
i=2 -> Z


distance

double distance(IXyz there)

bearingTo

IAngle bearingTo(IXyz there)
Return bearing CW from N in the range [0, 2PI)


asBearing

IAngle asBearing()
Return bearing CW from N in the range [0, 2PI)


gradientToFrac

double gradientToFrac(IXyz there)
Fractional gradient as dh/XY


asGradient

double asGradient()
Return the fractional gradient component of this vector


toRightOf

boolean toRightOf(IXyz pA,
                  IXyz pB)
Is point to right of line AB


parallelComponent

IXyz parallelComponent(IXyz v)
Return the component of v that is parallel with this


parallelComponentMag

double parallelComponentMag(IXyz v)
Return the magnitude of the component of v that is parallel with this


perpComponent

IXyz perpComponent(IXyz v)
Return the component of v that is perpendicular to this


negative

IXyz negative()
Return a negative of this vector, original unchanged


selfNormalize

IXyz selfNormalize()
Normalizes this vector in place, and returns itself.


normalized

IXyz normalized()
Returns normalized version of this vector, original unchanged.


cross

IXyz cross(IXyz v)
Return new vector result of cross with v, original vectors unchanged.


plus

IXyz plus(IXyz v)
Vector plus, returning new vector, originals unchanged.


minus

IXyz minus(IXyz v)
Vector minus, returning new vector, originals unchanged.


multipliedBy

IXyz multipliedBy(double d)
Multiply all components of Vector by given scalar, returning new vector, originals unchanged.


dividedBy

IXyz dividedBy(double d)
Divide all components of Vector by given scalar, returning new vector, originals unchanged.


add

void add(IXyz v)
Vector add operation in place.


subtract

void subtract(IXyz v)
Vector subtract operation in place.


crossWith

void crossWith(IXyz v)
Vector cross operation in place.


negate

void negate()
Negates the value of this xyz in place.


scale

void scale(double s)
Scalar multiply, in place


divide

void divide(double s)
Scalar divide, in place


multiply

void multiply(double s)
Scalar multiply, in place


dot

double dot(IXyz v)
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

lengthSquared

double lengthSquared()

truncateLength

IXyz truncateLength(double maxLength)
Clip to a given length, returning a new object if modification is required


angleBetween

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]

Parameters:
v - the other vector
Returns:
the angle in the range [0,180]

nearestPointOnLine

IXyz nearestPointOnLine(IXyz a,
                        IXyz b)
Returns the nearest point on line AB to this point.


rotate

void rotate(IXy xy,
            IAngle a)
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.


rotate

void rotate(IXya xya)
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.


rotationAsMove

IXyz rotationAsMove(IXy xy,
                    IAngle a)
Convert the given XY-plane rotation around an XY-axis into a translation


rotationAsMove

IXyz rotationAsMove(IXya xya)
Convert the given XY-plane rotation around an XY-axis into a translation


transform

IXyz transform(IXyz origin0,
               IAngle compass0,
               IXyz origin1,
               IAngle compass1)

nearestPointOn

IXyz nearestPointOn(IXyz a,
                    IXyz b,
                    boolean limitAB)
return the nearest point to "this" on line segment AB.

Parameters:
limitAB - if true, the point must be between A and B, inclusive

distance

double distance(IXyz a,
                IXyz b,
                boolean limitAB)
return the distance from "this" to line segment AB

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

abZ

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


isFinite

boolean isFinite()
Test if all components are finite and numbers (not NaN)


asDouble3

double[] asDouble3()
Returns this point/vector as an array of 3 doubles