Artenus 2D Framework
Artenus Reference
Represents a 2-dimensional point and is used throughout this framework for positions, scaling factors, impulses, and other properties of objects.
public final class Point2D

Field Summary

Modifier and TypeField and Description
public x
Represents the horizontal component of the point represented by this Point2D instance.
public y
Represents the vertical component of the point represented by this Point2D instance.

Constructor Summary

Modifier and TypeConstructor and Description
public Point2D(float px, float py)
Constructs a Point2D with the given components.

Method Summary

Modifier and TypeMethod and Description
public Point2Dmultiply(float scalar)
Multiplies a scalar value by both x and y components of this object and returns the result.
public voidsetZero()
Sets both x and y components of this object to zero.

Methods inherited from java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

x
public x
Represents the horizontal component of the point represented by this Point2D instance.
y
public y
Represents the vertical component of the point represented by this Point2D instance.

Constructor Detail

Point2D
public  Point2D(
    float px,
    float py
)
Constructs a Point2D with the given components.
Parameters:
pxThe x component of the point
pyThe y component of the point

Method Detail

multiply
public Point2D multiply(
    float scalar
)
Multiplies a scalar value by both x and y components of this object and returns the result. The values in the original Point2D object are not modified and the result is a new Point2D instance.
Parameters:
scalarThe scalar to multiply
Returns:
The resulting Point2D object which represents the new values
setZero
public void setZero()
Sets both x and y components of this object to zero.