- java.lang.Object
-
- be.yildizgames.common.geometry.Point2D
-
public final class Point2D extends Object
Class representing a 2d coordinate.- Author:
- Gregory Van den Borre
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Point2Dadd(float xValue, float yValue)Add this point values by the parameter x,y values.Point2Dadd(Point2D point)Add this point values by the parameter point values.booleanequals(Object obj)inthashCode()Point2DmultiplyByScalar(float scalar)Multiply the point x and y by the scalar value.Point2Dsubtract(float xValue, float yValue)Subtract this point values by the parameter x,y values.Point2Dsubtract(Point2D point)Subtract this point values by the parameter point values.StringtoString()static Point2DvalueOf(float x, float y)
-
-
-
Field Detail
-
ZERO
public static final Point2D ZERO
0,0 coordinate point.
-
x
public final float x
X coordinate.
-
y
public final float y
Y coordinate.
-
-
Method Detail
-
valueOf
public static Point2D valueOf(float x, float y)
-
add
public Point2D add(float xValue, float yValue)
Add this point values by the parameter x,y values.- Parameters:
xValue- Values to add to this point X value.yValue- Values to add to this point Y value.- Returns:
- The newly created point.
-
add
public Point2D add(Point2D point)
Add this point values by the parameter point values.- Parameters:
point- Values to use.- Returns:
- The newly created point.
-
equals
public boolean equals(Object obj)
-
hashCode
public int hashCode()
-
multiplyByScalar
public Point2D multiplyByScalar(float scalar)
Multiply the point x and y by the scalar value.- Parameters:
scalar- Value to multiply.- Returns:
- The newly created point.
-
subtract
public Point2D subtract(float xValue, float yValue)
Subtract this point values by the parameter x,y values.- Parameters:
xValue- Values to remove from this point X value.yValue- Values to remove from this point Y value.- Returns:
- The newly created point.
-
subtract
public Point2D subtract(Point2D point)
Subtract this point values by the parameter point values.- Parameters:
point- Values to use.- Returns:
- The newly created point.
-
-