Package nl.colorize.multimedialib.math
Class Point2D
- java.lang.Object
-
- nl.colorize.multimedialib.math.Point2D
-
public class Point2D extends java.lang.ObjectPoint with X and Y coordinates, defined with float precision.
-
-
Field Summary
Fields Modifier and Type Field Description static floatEPSILON
-
Constructor Summary
Constructors Constructor Description Point2D(float x, float y)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(float delta)voidadd(float deltaX, float deltaY)voidadd(Point2D p)floatcalculateAngle(Point2D other)Returns the angle in degrees from this point towards the specified other point.floatcalculateDistance(Point2D other)Returns the distance between this point and the specified other point.Point2Dcopy()booleanequals(java.lang.Object o)floatgetX()floatgetY()inthashCode()booleanisOrigin()voidmove(float deltaX, float deltaY)voidmultiply(float delta)voidmultiply(float deltaX, float deltaY)voidset(float x, float y)voidset(Point2D p)voidsetX(float x)voidsetY(float y)java.lang.StringtoString()
-
-
-
Field Detail
-
EPSILON
public static final float EPSILON
- See Also:
- Constant Field Values
-
-
Method Detail
-
setX
public void setX(float x)
-
getX
public float getX()
-
setY
public void setY(float y)
-
getY
public float getY()
-
set
public void set(float x, float y)
-
set
public void set(Point2D p)
-
move
public void move(float deltaX, float deltaY)
-
add
public void add(float deltaX, float deltaY)
-
add
public void add(float delta)
-
add
public void add(Point2D p)
-
multiply
public void multiply(float deltaX, float deltaY)
-
multiply
public void multiply(float delta)
-
calculateDistance
public float calculateDistance(Point2D other)
Returns the distance between this point and the specified other point.
-
calculateAngle
public float calculateAngle(Point2D other)
Returns the angle in degrees from this point towards the specified other point. If the points are identical this will return an angle of 0.
-
isOrigin
public boolean isOrigin()
-
copy
public Point2D copy()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-