org.osm2world.core.math
Class VectorXZ
Object
VectorXZ
- All Implemented Interfaces:
- Vector3D
public class VectorXZ
- extends Object
- implements Vector3D
immutable two-dimensional vector with x and z component
Constructor Summary |
VectorXZ(double x,
double z)
|
Methods inherited from class Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
x
public final double x
z
public final double z
NULL_VECTOR
public static final VectorXZ NULL_VECTOR
X_UNIT
public static final VectorXZ X_UNIT
Z_UNIT
public static final VectorXZ Z_UNIT
VectorXZ
public VectorXZ(double x,
double z)
getX
public double getX()
- Specified by:
getX
in interface Vector3D
getY
public double getY()
- Specified by:
getY
in interface Vector3D
getZ
public double getZ()
- Specified by:
getZ
in interface Vector3D
length
public double length()
lengthSquared
public double lengthSquared()
normalize
public VectorXZ normalize()
add
public VectorXZ add(VectorXZ other)
- adds the parameter to this vector and returns the result
subtract
public VectorXZ subtract(VectorXZ other)
- subtracts the parameter from this vector and returns the result
mult
public VectorXZ mult(double scalar)
invert
public VectorXZ invert()
dot
public double dot(VectorXZ other)
rightNormal
public 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).
It's the vector that, seen from "above", points to the right
side of this vector and is orthogonal to it.
The resulting vector's length is 1.
distanceTo
public double distanceTo(VectorXZ other)
toString
public String toString()
- Overrides:
toString
in class Object
xyz
public VectorXYZ xyz(double y)
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
distance
public static final double distance(VectorXZ v1,
VectorXZ v2)
distanceSquared
public static final double distanceSquared(VectorXZ v1,
VectorXZ v2)
listXYZ
public static final List<VectorXYZ> listXYZ(List<VectorXZ> vs,
double y)
distanceFunction
public static final Function<VectorXZ,Double> distanceFunction(VectorXZ v1)
xyzFunction
public static final Function<VectorXZ,VectorXYZ> xyzFunction(double y)