Package nl.colorize.multimedialib.math
Class Point
- java.lang.Object
-
- nl.colorize.multimedialib.math.Point
-
public class Point 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 Point(float x, float y)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(float deltaX, float deltaY)floatcalculateAngle(Point other)Returns the angle in degrees from this point towards the specified other point.floatcalculateDistance(Point other)Returns the distance between this point and the specified other point.Pointcopy()booleanequals(java.lang.Object o)floatgetX()floatgetY()inthashCode()voidmove(float deltaX, float deltaY)voidset(float x, float y)voidset(Point 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(Point p)
-
move
public void move(float deltaX, float deltaY)
-
add
public void add(float deltaX, float deltaY)
-
calculateDistance
public float calculateDistance(Point other)
Returns the distance between this point and the specified other point.
-
calculateAngle
public float calculateAngle(Point 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.
-
copy
public Point 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
-
-