Package org.locationtech.jts.math
Class Vector3D
java.lang.Object
org.locationtech.jts.math.Vector3D
Represents a vector in 3-dimensional Cartesian space.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionVector3D
(double x, double y, double z) Vector3D
(Coordinate from, Coordinate to) -
Method Summary
Modifier and TypeMethodDescriptionstatic Vector3D
create
(double x, double y, double z) Creates a new vector with given X and Y components.static Vector3D
create
(Coordinate coord) Creates a vector from aCoordinate
.private Vector3D
divide
(double d) static double
dot
(Coordinate v1, Coordinate v2) Computes the 3D dot-product of twoCoordinate
s.static double
dot
(Coordinate A, Coordinate B, Coordinate C, Coordinate D) Computes the dot product of the 3D vectors AB and CD.double
Computes the dot-product of two vectorsdouble
getX()
double
getY()
double
getZ()
double
length()
static double
length
(Coordinate v) static Coordinate
toString()
Gets a string representation of this vector
-
Field Details
-
x
private double x -
y
private double y -
z
private double z
-
-
Constructor Details
-
Vector3D
-
Vector3D
-
Vector3D
public Vector3D(double x, double y, double z)
-
-
Method Details
-
dot
Computes the dot product of the 3D vectors AB and CD.- Parameters:
A
-B
-C
-D
-- Returns:
- the dot product
-
create
Creates a new vector with given X and Y components.- Parameters:
x
- the x componenty
- the y componentz
- the z component- Returns:
- a new vector
-
create
Creates a vector from aCoordinate
.- Parameters:
coord
- the Coordinate to copy- Returns:
- a new vector
-
dot
Computes the 3D dot-product of twoCoordinate
s.- Parameters:
v1
- the first vectorv2
- the second vector- Returns:
- the dot product of the vectors
-
getX
public double getX() -
getY
public double getY() -
getZ
public double getZ() -
dot
Computes the dot-product of two vectors- Parameters:
v
- a vector- Returns:
- the dot product of the vectors
-
length
public double length() -
length
-
normalize
-
divide
-
normalize
-
toString
Gets a string representation of this vector
-