|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.pogamut.MessageObjects.Triple
public class Triple
Triple implemets triple of double - used in representation of location, rotation, velocity
Triple has couple handy methods like add, substract, distance (in 2D and in 3D) which
are usefull while designing agent in complex virtual environment
Field Summary | |
---|---|
static double |
EPSILON
|
private int |
hashCode
|
double |
x
|
double |
y
|
double |
z
|
Constructor Summary | |
---|---|
Triple()
|
|
Triple(double[] triple)
|
|
Triple(double x,
double y,
double z)
|
|
Triple(Triple t)
|
Method Summary | |
---|---|
static Triple |
add(Triple a,
Triple b)
makes addition, example call, we got triples x, y: z = x + y can be written like: z = add(x,y); or z = add(y,x); |
static double |
angle(Triple a,
Triple b)
Returns angle in radians. |
Tuple2D |
asTuple2D()
Returns tuple2d from x,y of this triple. |
Tuple3D |
asTuple3D()
|
Vertex3D |
asVertex3D()
|
java.lang.Object |
clone()
|
static double |
degToRad(double deg)
Degrees to radians. |
static double |
distanceInPlane(Triple a,
Triple b)
Computes Euclidean distance in 2D space, according to x and y aces |
static double |
distanceInSpace(Triple a,
Triple b)
Computes Euclidean distance in 3D space |
java.lang.Double |
dot(Triple t)
Dot product. |
boolean |
epsilonEquals(Triple a)
Returns whether this == a (Triple.EPSILON precision) |
boolean |
epsilonEquals(Triple a,
double epsilon)
Returns whether this == a (epsilon precision) |
boolean |
equals(java.lang.Object obj)
|
private int |
getHashCode()
|
int |
hashCode()
|
Triple |
inverse()
|
static Triple |
multiplyByNumber(Triple a,
java.lang.Double b)
multiple vector by a number - every coordination separately |
static double |
multiScalar(Triple a,
Triple b)
|
Triple |
normalize()
Normalize the vector. |
static double |
radToDeg(double rad)
Radians to degrees. |
static double |
radToUTAngle(double angle)
|
static Triple |
rotateYawPitchRoll(Triple a,
double yawRad,
double pitchRad,
double rollRad)
|
static Triple |
rotationAsVector(Triple rotationInRad)
|
static Triple |
rotationAsVectorUTUnits(Triple rotationInUTUnits)
|
void |
setTriple(Triple newTriple)
|
static Triple |
subtract(Triple a,
Triple b)
makes subraction example call: z = x - y => z = subtract(x,y); |
java.lang.String |
toString()
|
static double |
utAngleToRad(double angle)
|
double |
vectorSize()
|
static double |
vectorSize(Triple a)
counts size of the vector - distance from the (0,0,0) |
boolean |
zero()
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final double EPSILON
public double x
public double y
public double z
private final int hashCode
Constructor Detail |
---|
public Triple(double[] triple)
public Triple()
public Triple(double x, double y, double z)
public Triple(Triple t)
Method Detail |
---|
private int getHashCode()
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.Double dot(Triple t)
t
-
public java.lang.String toString()
toString
in class java.lang.Object
public void setTriple(Triple newTriple)
public static Triple add(Triple a, Triple b)
public Triple normalize()
public static Triple subtract(Triple a, Triple b)
a
- b
-
public static Triple multiplyByNumber(Triple a, java.lang.Double b)
public static double distanceInSpace(Triple a, Triple b)
a
- b
-
public static double distanceInPlane(Triple a, Triple b)
a
- b
-
public static double vectorSize(Triple a)
a
- - vector
public double vectorSize()
public boolean zero()
public static double utAngleToRad(double angle)
public static double radToUTAngle(double angle)
public static Triple rotateYawPitchRoll(Triple a, double yawRad, double pitchRad, double rollRad)
public static Triple rotationAsVector(Triple rotationInRad)
rotationInRad
- in radians pitch, yaw, roll (same order as sent by GameBots)
public static Triple rotationAsVectorUTUnits(Triple rotationInUTUnits)
rotationInRad
- in UTUnits (0..65535) pitch, yaw, roll (same order as sent by GameBots)
public Triple inverse()
public static double multiScalar(Triple a, Triple b)
public boolean epsilonEquals(Triple a, double epsilon)
a
- epsilon
-
public boolean epsilonEquals(Triple a)
a
- epsilon
-
public static double angle(Triple a, Triple b)
a
- b
-
public static double degToRad(double deg)
deg
-
public static double radToDeg(double rad)
rad
-
public Tuple3D asTuple3D()
public Vertex3D asVertex3D()
public Tuple2D asTuple2D()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |