|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsim.util.MutableDouble2D
public final class MutableDouble2D
MutableDouble2D is more or less the same class as java.awt.geom.Point2D.Double, except that it is hash-equivalent to Double2D.
Just as with MutableInt2D: you use MutableDouble2D as a STORED hash key at your peril: it has the same misfeature as java.awt.geom.Point2D.Double, and you should read the warning in Double2D. However, you can look up Double2D-keyed objects in a hash table by passing in a MutableDouble2D instead.
Field Summary | |
---|---|
double |
x
|
double |
y
|
Constructor Summary | |
---|---|
MutableDouble2D()
|
|
MutableDouble2D(Double2D p)
|
|
MutableDouble2D(double x,
double y)
|
|
MutableDouble2D(Int2D p)
|
|
MutableDouble2D(MutableDouble2D p)
|
|
MutableDouble2D(MutableInt2D p)
|
|
MutableDouble2D(java.awt.Point p)
|
|
MutableDouble2D(java.awt.geom.Point2D.Double p)
|
|
MutableDouble2D(java.awt.geom.Point2D.Float p)
|
|
MutableDouble2D(java.awt.geom.Point2D p)
Only included for completeness' sakes, in case a new Point2D subclass is created in the future. |
Method Summary | |
---|---|
MutableDouble2D |
add(MutableDouble2D other1,
MutableDouble2D other2)
Sets me to the sum of other1 and other2, returning me. |
MutableDouble2D |
addIn(Double2D other)
Adds other into me, returning me. |
MutableDouble2D |
addIn(double x,
double y)
Adds the x and y values into my x and y values, returning me. |
MutableDouble2D |
addIn(MutableDouble2D other)
Adds other into me, returning me. |
double |
angle()
Returns the length of the vector between -Pi and Pi. |
double |
distance(Double2D p)
Returns the distance FROM this MutableDouble2D TO the specified point. |
double |
distance(double x,
double y)
Returns the distance FROM this MutableDouble2D TO the specified point |
double |
distance(Int2D p)
Returns the distance FROM this MutableDouble2D TO the specified point. |
double |
distance(MutableDouble2D p)
Returns the distance FROM this MutableDouble2D TO the specified point. |
double |
distance(MutableInt2D p)
Returns the distance FROM this MutableDouble2D TO the specified point. |
double |
distance(java.awt.geom.Point2D p)
Returns the distance FROM this MutableDouble2D TO the specified point. |
double |
distanceSq(Double2D p)
Returns the distance FROM this MutableDouble2D TO the specified point. |
double |
distanceSq(double x,
double y)
Returns the distance FROM this MutableDouble2D TO the specified point |
double |
distanceSq(Int2D p)
Returns the distance FROM this MutableDouble2D TO the specified point. |
double |
distanceSq(MutableDouble2D p)
Returns the distance FROM this MutableDouble2D TO the specified point. |
double |
distanceSq(MutableInt2D p)
Returns the distance FROM this MutableDouble2D TO the specified point. |
double |
distanceSq(java.awt.geom.Point2D p)
Returns the distance FROM this Point2D TO the specified point |
double |
dot(MutableDouble2D other)
Returns the dot product of myself against other, that is me DOT other. |
MutableDouble2D |
dup()
Equivalent to (new MutableDouble2D(d)), but (d.dup()) shorter of course, but perhaps not quite as fast. |
boolean |
equals(java.lang.Object obj)
|
double |
getX()
|
double |
getY()
|
int |
hashCode()
|
double |
length()
Returns the length of the vector. |
double |
lengthSq()
Returns the square of the length of the MutableDouble2D. |
MutableDouble2D |
multiply(MutableDouble2D other,
double val)
Multiplies other by val, setting me to the result and returning me. |
MutableDouble2D |
multiplyIn(double val)
Extends my length so that it is multiplied by val, and returns me. |
void |
negate()
Negates the MutableDouble2D's values |
MutableDouble2D |
normalize()
|
double |
perpDot(MutableDouble2D other)
2D version of the cross product: returns the dot product of me rotated 90 degrees dotted against the other vector. |
MutableDouble2D |
rotate(double theta)
Rotates me by theta radians, returning me. |
MutableDouble2D |
setLength(double val)
Sets my length, which should be >= 0. |
void |
setTo(Double2D b)
|
void |
setTo(double bx,
double by)
|
void |
setTo(Int2D b)
|
void |
setTo(MutableDouble2D b)
|
void |
setTo(MutableInt2D b)
|
void |
setToMinus(MutableDouble2D b)
Sets the values to the negation of the values in the provided MutableDouble2D |
void |
setX(double val)
|
void |
setY(double val)
|
MutableDouble2D |
subtract(MutableDouble2D other1,
MutableDouble2D other2)
Subtracts other2 from other1, setting me to the result and returning me. |
MutableDouble2D |
subtractIn(Double2D other)
Sets me to me minus other, returning me. |
MutableDouble2D |
subtractIn(MutableDouble2D other)
Sets me to me minus other, returning me. |
java.lang.String |
toCoordinates()
|
java.lang.String |
toString()
|
void |
zero()
Sets the values to 0. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public double x
public double y
Constructor Detail |
---|
public MutableDouble2D()
public MutableDouble2D(Int2D p)
public MutableDouble2D(MutableInt2D p)
public MutableDouble2D(MutableDouble2D p)
public MutableDouble2D(Double2D p)
public MutableDouble2D(java.awt.Point p)
public MutableDouble2D(java.awt.geom.Point2D.Double p)
public MutableDouble2D(java.awt.geom.Point2D.Float p)
public MutableDouble2D(java.awt.geom.Point2D p)
public MutableDouble2D(double x, double y)
Method Detail |
---|
public final double getX()
public final double getY()
public final void setX(double val)
public final void setY(double val)
public final void setTo(double bx, double by)
public final void setTo(Int2D b)
public final void setTo(Double2D b)
public final void setTo(MutableInt2D b)
public final void setTo(MutableDouble2D b)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toCoordinates()
public final int hashCode()
hashCode
in class java.lang.Object
public final boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public double distance(double x, double y)
public double distance(MutableDouble2D p)
public double distance(Double2D p)
public double distance(Int2D p)
public double distance(MutableInt2D p)
public double distance(java.awt.geom.Point2D p)
public double distanceSq(double x, double y)
public double distanceSq(Double2D p)
public double distanceSq(MutableDouble2D p)
public double distanceSq(Int2D p)
public double distanceSq(MutableInt2D p)
public double distanceSq(java.awt.geom.Point2D p)
public final MutableDouble2D addIn(Double2D other)
public final MutableDouble2D addIn(MutableDouble2D other)
public final MutableDouble2D addIn(double x, double y)
public final MutableDouble2D add(MutableDouble2D other1, MutableDouble2D other2)
public final MutableDouble2D dup()
public final MutableDouble2D subtractIn(Double2D other)
public final MutableDouble2D subtractIn(MutableDouble2D other)
public final MutableDouble2D subtract(MutableDouble2D other1, MutableDouble2D other2)
public final double length()
public final double angle()
public final MutableDouble2D multiplyIn(double val)
public final MutableDouble2D multiply(MutableDouble2D other, double val)
public final MutableDouble2D normalize()
public final MutableDouble2D setLength(double val)
public final MutableDouble2D rotate(double theta)
public final double dot(MutableDouble2D other)
public double perpDot(MutableDouble2D other)
public final void zero()
public final void setToMinus(MutableDouble2D b)
public final void negate()
public final double lengthSq()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |