Documentation

Point
in package
implements ArrayAccess

Representation of the coordinates of a point.

Table of Contents

Interfaces

ArrayAccess

Properties

$x  : float
$y  : float

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
float

getY()

Retrieves the y coordinate.

public getY() : float
Return values
float

offsetExists()

Whether an offset exists.

public offsetExists(int|string $offset) : bool
Parameters
$offset : int|string

Use 0 or 1.

Return values
bool

offsetGet()

Get an offset value.

public offsetGet(int|string $offset) : float
Parameters
$offset : int|string

Use 0 or 1.

Tags
throws
InvalidArgumentException

If the offset is not 0 or 1.

Return values
float

offsetSet()

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
throws
InvalidArgumentException

If the offset is not 0 or 1.

offsetUnset()

Get an offset value.

public offsetUnset(int|string $offset) : void
Parameters
$offset : int|string

Use 0 or 1.

Tags
throws
InvalidArgumentException

If the offset is not 0 or 1.


        
On this page

Search results