Package oracle.spatial.geometry
Class JPoint3DD
- java.lang.Object
-
- oracle.spatial.geometry.JPoint3DD
-
- Direct Known Subclasses:
UnitSphere
public class JPoint3DD extends java.lang.Object
Immutable 3D point or vector.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JPoint3DD
cross(JPoint3DD a, JPoint3DD b)
Return the cross product (a x b).static double
dot(JPoint3DD a, JPoint3DD b)
Return the dot product of two 3D vectors.boolean
equals(java.lang.Object obj)
double
getX()
Get x.double
getY()
Get y.double
getZ()
Get z.int
hashCode()
boolean
isZero()
Test if all three values x, y, and z are zero.double
length()
Return the length of the vector.java.lang.String
toString()
-
-
-
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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-