PointSigned
in package
implements
PointInterface
FinalYes
A point class that allows negative values of coordinates.
Table of Contents
Interfaces
- PointInterface
- The point interface.
Properties
Methods
- __construct() : mixed
- Constructs a point of coordinates.
- __toString() : string
- Gets a string representation for the current point.
- getX() : int
- Gets points x coordinate.
- getY() : int
- Gets points y coordinate.
- in() : bool
- Checks if current coordinate is inside a given box.
- move() : PointInterface
- Returns another point, moved by a given amount from current coordinates.
Properties
$x
private
int
$x
$y
private
int
$y
Methods
__construct()
Constructs a point of coordinates.
public
__construct(int $x, int $y) : mixed
Parameters
- $x : int
- $y : int
Tags
__toString()
Gets a string representation for the current point.
public
__toString() : string
Tags
Return values
stringgetX()
Gets points x coordinate.
public
getX() : int
Tags
Return values
intgetY()
Gets points y coordinate.
public
getY() : int
Tags
Return values
intin()
Checks if current coordinate is inside a given box.
public
in(BoxInterface $box) : bool
Parameters
- $box : BoxInterface
Tags
Return values
boolmove()
Returns another point, moved by a given amount from current coordinates.
public
move(mixed $amount) : PointInterface
Parameters
- $amount : mixed