Point
in package
implements
ArrayAccess
Representation of the coordinates of a point.
Table of Contents
Interfaces
- ArrayAccess
Properties
Methods
- __construct() : mixed
- getX() : float
- Retrieves the x coordinate.
- getY() : float
- Retrieves the y coordinate.
- offsetExists() : bool
- Whether an offset exists.
- offsetGet() : float
- Get an offset value.
- offsetSet() : void
- Set an offset value.
- offsetUnset() : void
- Get an offset value.
Properties
$x
private
float
$x
X coordinate.
$y
private
float
$y
Y coordinate.
Methods
__construct()
public
__construct(float $x, float $y) : mixed
Parameters
- $x : float
-
Input x coordinate.
- $y : float
-
Input y coordinate.
getX()
Retrieves the x coordinate.
public
getX() : float
Return values
floatgetY()
Retrieves the y coordinate.
public
getY() : float
Return values
floatoffsetExists()
Whether an offset exists.
public
offsetExists(int|string $offset) : bool
Parameters
- $offset : int|string
-
Use 0 or 1.
Return values
booloffsetGet()
Get an offset value.
public
offsetGet(int|string $offset) : float
Parameters
- $offset : int|string
-
Use 0 or 1.
Tags
Return values
floatoffsetSet()
Set an offset value.
public
offsetSet(int|string $offset, float|int|string $value) : void
Parameters
- $offset : int|string
-
Use 0 or 1.
- $value : float|int|string
-
Coordinate value to set.
Tags
offsetUnset()
Get an offset value.
public
offsetUnset(int|string $offset) : void
Parameters
- $offset : int|string
-
Use 0 or 1.