org.osm2world.core.math
public class VectorXYZ extends Object implements Vector3D, IntersectionTestObject
Modifier and Type | Field and Description |
---|---|
static VectorXYZ |
NULL_VECTOR |
double |
x |
static VectorXYZ |
X_UNIT |
double |
y |
static VectorXYZ |
Y_UNIT |
double |
z |
static VectorXYZ |
Z_UNIT |
Constructor and Description |
---|
VectorXYZ(double x2,
double y2,
double z2) |
Modifier and Type | Method and Description |
---|---|
VectorXYZ |
add(double x,
double y,
double z) |
VectorXYZ |
add(VectorXYZ other) |
VectorXYZ |
add(VectorXZ other) |
VectorXYZ |
addY(double y) |
static List<VectorXYZ> |
addYList(List<VectorXYZ> list,
double addY) |
double |
angleTo(VectorXYZ other)
calculates the angle between this vector and other,
but only if both are normalized!
|
VectorXYZ |
cross(VectorXYZ other) |
VectorXYZ |
crossNormalized(VectorXYZ other)
same result as calling
normalize() after
cross(VectorXYZ) , but avoids creating a temporary vector |
double |
distanceTo(VectorXYZ other) |
double |
distanceToSquared(VectorXYZ other) |
double |
distanceToXZ(VectorXYZ other) |
double |
distanceToXZ(VectorXZ other) |
double |
dot(VectorXYZ other) |
boolean |
equals(Object obj) |
AxisAlignedBoundingBoxXZ |
getAxisAlignedBoundingBoxXZ() |
double |
getX() |
double |
getY() |
double |
getZ() |
int |
hashCode() |
VectorXYZ |
invert() |
double |
length() |
double |
lengthSquared() |
VectorXYZ |
mult(double scalar) |
VectorXYZ |
normalize() |
VectorXYZ |
rotateVec(double angleRad,
VectorXYZ n)
returns the result of rotating this vector around the
given normalized vector n
|
VectorXYZ |
rotateVec(double angleRad,
VectorXYZ rotOrigin,
VectorXYZ rotAxis)
returns the result of rotating this vector around a freely chosen
axis and origin
|
VectorXYZ |
rotateX(double angleRad)
returns the result of rotating this vector around the x axis
|
VectorXYZ |
rotateY(double angleRad)
returns the result of rotating this vector around the y axis
|
VectorXYZ |
rotateZ(double angleRad)
returns the result of rotating this vector around the z axis
|
VectorXYZ |
subtract(VectorXYZ other) |
VectorXYZ |
subtract(VectorXZ other) |
String |
toString() |
VectorXYZ |
x(double x) |
static VectorXYZ |
xyz(VectorXYZ vector3D)
creates a VectorXYZ for any Vector3D object.
|
VectorXZ |
xz() |
VectorXYZ |
y(double y) |
VectorXYZ |
z(double z) |
public final double x
public final double y
public final double z
public static final VectorXYZ NULL_VECTOR
public static final VectorXYZ X_UNIT
public static final VectorXYZ Y_UNIT
public static final VectorXYZ Z_UNIT
public double length()
public double lengthSquared()
public VectorXYZ normalize()
public VectorXYZ add(double x, double y, double z)
public VectorXYZ addY(double y)
public VectorXYZ crossNormalized(VectorXYZ other)
normalize()
after
cross(VectorXYZ)
, but avoids creating a temporary vectorpublic double dot(VectorXYZ other)
public VectorXYZ mult(double scalar)
public String toString()
toString
in class Object
public VectorXYZ rotateX(double angleRad)
angleRad
- angle in radianspublic VectorXYZ rotateY(double angleRad)
angleRad
- angle in radianspublic VectorXYZ rotateZ(double angleRad)
angleRad
- angle in radianspublic VectorXYZ rotateVec(double angleRad, VectorXYZ n)
angleRad
- angle in radiansn
- normalized vectorpublic VectorXYZ rotateVec(double angleRad, VectorXYZ rotOrigin, VectorXYZ rotAxis)
angleRad
- angle in radiansrotOrigin
- normalized vector for the rotation originrotAxis
- normalized vector for the rotation axispublic double angleTo(VectorXYZ other)
public double distanceTo(VectorXYZ other)
public double distanceToSquared(VectorXYZ other)
public double distanceToXZ(VectorXZ other)
public double distanceToXZ(VectorXYZ other)
public VectorXYZ x(double x)
public VectorXYZ y(double y)
public VectorXYZ z(double z)
public VectorXYZ invert()
public AxisAlignedBoundingBoxXZ getAxisAlignedBoundingBoxXZ()
getAxisAlignedBoundingBoxXZ
in interface IntersectionTestObject
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public static VectorXYZ xyz(VectorXYZ vector3D)