com.annahid.libs.artenus.data
Point2D
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 Type | Field and Description |
|---|---|
public | xRepresents the horizontal component of the point represented by this Point2D
instance. |
public | yRepresents the vertical component of the point represented by this Point2D instance. |
Constructor Summary
| Modifier and Type | Constructor and Description |
|---|---|
public | Point2D(float px, float py) Constructs a Point2D with the given components. |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
public Point2D | multiply(float scalar) Multiplies a scalar value by both x and y components of this object and returns the result. |
public void | setZero() 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, waitField 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:
|
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:
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. |