Class el.Point
A pair of x,y coordinates.
-
Point.new ()
-
Create a new point with x and y = 0.
Returns:
el.Point
-
Point.new (x, y)
-
Create a new point.
Parameters:
- x
number
X coordinate
- y
number
Y coordinate
Returns:
el.Point
-
Point.x
-
X coord (number)
-
Point.x
-
Y coord (number)
-
Point:isOrigin ()
-
True if is the origin point
-
Point:isFinite ()
-
True if is finite
-
Point:withX (x)
-
Returns a point with the given x coordinate.
Parameters:
Returns:
el.Point
New point object
-
Point:withY (y)
-
Returns a point with the given y coordinate.
Parameters:
Returns:
el.Point
New point object
-
Point:setXY (x, y)
-
Set x and y at the same time.
Parameters:
- x
number
New x coordinate
- y
number
New y coordinate
-
Point:addXY (x, y)
-
Adds a pair of coordinates to this value.
Parameters:
- x
number
X to add
- y
number
Y to add
-
Point:translated (deltax, deltay)
-
Move the point by delta x and y.
Parameters:
- deltax
number
- deltay
number
-
Point:distance ()
-
Distance to another point.
-
Point:distanceSquared ()
-
Distance from another point (squared).
-
Point:angleTo (other)
-
Returns the angle from this point to another one.
Taking this point to be the centre of a circle, and the other point being a position on
the circumference, the return value is the number of radians clockwise from the 12 o'clock
direction.
So 12 o'clock = 0, 3 o'clock = Pi/2, 6 o'clock = Pi, 9 o'clock = -Pi/2
Parameters:
-
Point:rotated ()
-
Get a rotated copy.
Returns:
el.Point
-
Point:dotProduct ()
-
Returns the dot product.
Returns:
number
-
Point:toInt ()
-
Convert to integer values.
Returns:
int