Functions
Methods
Metamethods

Functions

Point.Point(x, y)

Create a new Point

Parameters

x: The X coordinate for the Point.

y: The Y coordinate for the Point.

Returns

A new Point table.

Methods

Point:log()

Print the X & Y values for the Point

Point:move(x, y)

Move a Point along X and Y.

Parameters

x: The X vgalue to move the Point by.

y: The Y value to move the Point by.

Returns

Returns self.

Point:move_direction(direction, length)

Move a Point in a direction by length

Parameters

direction: Angle to move the Point in.

length: The distance to move along.

Returns

Returns self.

Point:rotate(angle, origin)

Rotate the Point clockwise around an origin Point in degrees.

Parameters

angle: The angle to rotate the Point by.

origin: A Point to rotate around.

Returns

Returns self.

Point:distance_to(point_2)

Return the distance between the Point and a second Point.

Parameters

point_2: A second Point

Returns

Distance (number)

Point:angle_to(point_2)

Return the angle between the Point and a second Point.

Parameters

point_2: A second Point

Returns

Angle in degrees (number)

Point:clone()

Return an identical copy of a Point.

Returns

A new Point

Metamethods

point:__add(point_2)

Add another Point to the Point.

Parameters

point_2: A second Point.

Returns

A new Point.

point:__sub(point_2)

Subtract another Point from the Point.

Parameters

point_2: A second Point.

Returns

A new Point.

point:__eq(point_2)

Check if a Point is equal to another Point.

Parameters

point_2: A second Point.

Returns

A new Point.

point:__tostring()

Get a representation of the Point as a string.

Returns

A string representation of the Point.