|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object VectorXZ
public class VectorXZ
immutable two-dimensional vector with x and z component
Field Summary | |
---|---|
static VectorXZ |
NULL_VECTOR
|
double |
x
|
static VectorXZ |
X_UNIT
|
double |
z
|
static VectorXZ |
Z_UNIT
|
Constructor Summary | |
---|---|
VectorXZ(double x,
double z)
|
Method Summary | |
---|---|
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). |
double |
angleTo(VectorXZ other)
|
static double |
distance(VectorXZ v1,
VectorXZ v2)
|
static Function<VectorXZ,Double> |
distanceFunction(VectorXZ v1)
|
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 |
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)
|
Methods inherited from class Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
public VectorXZ(double x, double z)
Method Detail |
---|
public double getX()
getX
in interface Vector3D
public double getY()
getY
in interface Vector3D
public double getZ()
getZ
in interface Vector3D
public double length()
public double lengthSquared()
public VectorXZ normalize()
public VectorXZ add(VectorXZ other)
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 double angleTo(VectorXZ other)
angle()
public 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 final double distance(VectorXZ v1, VectorXZ v2)
public static final double distanceSquared(VectorXZ v1, VectorXZ v2)
public static final List<VectorXYZ> listXYZ(List<VectorXZ> vs, double y)
public static final Function<VectorXZ,Double> distanceFunction(VectorXZ v1)
public static final Function<VectorXZ,VectorXYZ> xyzFunction(double y)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |