org.osm2world.core.math
Modifier and Type | Field and Description |
---|---|
static VectorXZ |
NULL_VECTOR |
double |
x |
static VectorXZ |
X_UNIT |
double |
z |
static VectorXZ |
Z_UNIT |
Constructor and Description |
---|
VectorXZ(double x,
double z) |
Modifier and Type | Method and Description |
---|---|
VectorXZ |
add(VectorXZ other)
adds the parameter to this vector and returns the result
|
double |
angle()
gets this vector's angle relative to (0,1).
|
static double |
angleBetween(VectorXZ v1,
VectorXZ v2)
returns the angle between two direction vectors
|
double |
angleTo(VectorXZ other) |
static double |
distance(VectorXZ v1,
VectorXZ v2) |
static double |
distanceSquared(VectorXZ v1,
VectorXZ v2) |
double |
distanceTo(VectorXZ other) |
double |
dot(VectorXZ other) |
boolean |
equals(Object obj) |
static VectorXZ |
fromAngle(double directionRad)
returns a unit vector based on an angular direction.
|
double |
getX() |
double |
getY() |
double |
getZ() |
int |
hashCode() |
VectorXZ |
invert() |
double |
length() |
double |
lengthSquared() |
static List<VectorXYZ> |
listXYZ(List<VectorXZ> vs,
double y) |
VectorXZ |
mult(double scalar) |
VectorXZ |
normalize() |
VectorXZ |
rightNormal()
returns the vector that would result from calculating the
cross product of this vector (normalized and extended
to three dimensions) and (0,1,0).
|
VectorXZ |
rotate(double angleRad)
returns the result of rotating this vector clockwise around the origin
|
VectorXZ |
subtract(VectorXZ other)
subtracts the parameter from this vector and returns the result
|
String |
toString() |
VectorXYZ |
xyz(double y) |
static Function<VectorXZ,VectorXYZ> |
xyzFunction(double y) |
VectorXZ |
xz() |
public final double x
public final double z
public static final VectorXZ NULL_VECTOR
public static final VectorXZ X_UNIT
public static final VectorXZ Z_UNIT
public double length()
public double lengthSquared()
public VectorXZ normalize()
public VectorXZ subtract(VectorXZ other)
public VectorXZ mult(double scalar)
public VectorXZ invert()
public double dot(VectorXZ other)
public VectorXZ rightNormal()
public double distanceTo(VectorXZ other)
public double angle()
fromAngle(double)
.public VectorXZ rotate(double angleRad)
angleRad
- angle in radianspublic String toString()
toString
in class Object
public VectorXYZ xyz(double y)
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public static VectorXZ fromAngle(double directionRad)
directionRad
- direction angle in radianspublic static double angleBetween(VectorXZ v1, VectorXZ v2)