Package oracle.spatial.geometry
Class JPoint3DD
- java.lang.Object
-
- oracle.spatial.geometry.JPoint3DD
-
- Direct Known Subclasses:
UnitSphere
public class JPoint3DD extends java.lang.ObjectImmutable 3D point or vector.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JPoint3DDcross(JPoint3DD a, JPoint3DD b)Return the cross product (a x b).static doubledot(JPoint3DD a, JPoint3DD b)Return the dot product of two 3D vectors.booleanequals(java.lang.Object obj)doublegetX()Get x.doublegetY()Get y.doublegetZ()Get z.inthashCode()booleanisZero()Test if all three values x, y, and z are zero.doublelength()Return the length of the vector.java.lang.StringtoString()
-
-
-
Constructor Detail
-
JPoint3DD
public JPoint3DD()
Creata the zero vector.
-
JPoint3DD
public JPoint3DD(double x, double y, double z)Create a 3D point or vector.- Parameters:
x-y-z-
-
JPoint3DD
protected JPoint3DD(double x, double y, double z, double divisor)Create a scaled JPoint3DD, (x, y, z)/divisor. If the divisor is zero, will create a zero vector (instead of dividing by zero).- Parameters:
x-y-z-divisor- amount to divide (x, y, z) by; if zero, creates a zero vector.
-
-
Method Detail
-
getX
public final double getX()
Get x.- Returns:
- x value
-
getY
public final double getY()
Get y.- Returns:
- y value
-
getZ
public final double getZ()
Get z.- Returns:
- z value
-
length
public final double length()
Return the length of the vector.- Returns:
- cartesian length
-
isZero
public final boolean isZero()
Test if all three values x, y, and z are zero.- Returns:
- true if this is the zero vector.
-
cross
public static final JPoint3DD cross(JPoint3DD a, JPoint3DD b)
Return the cross product (a x b).- Parameters:
a-b-- Returns:
- cross product
-
dot
public static final double dot(JPoint3DD a, JPoint3DD b)
Return the dot product of two 3D vectors.- Parameters:
a-b-- Returns:
- dot product
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-