Module Shapes.TRIANGLE
TRIANGLE class with properties and methods for handling triangles.
This class is mostly used by the POLYGON class, but you can use it on its own as well
Author: nielsvaes/coconutcockpit
Global(s)
Global TRIANGLE |
Type(s)
Fields and Methods inherited from CUBE | Description |
---|---|
Name of the class. |
|
coordinates of the line |
|
points of the line |
Fields and Methods inherited from TRIANGLE | Description |
---|---|
Checks if a point is contained within the triangle. |
|
Draws the triangle on the map, just for debugging |
|
Returns a random Vec2 within the triangle. |
|
Creates a new triangle from three points. |
|
Removes the drawing of the triangle from the map. |
LINE class.
Field(s)
Name of the class.
coordinates of the line
points of the line
Function(s)
Field(s)
Function(s)
Checks if a point is contained within the triangle.
Defined in:
TRIANGLE
Parameters:
#table pt
The point to check
#table points
(optional) The points of the triangle, or 3 other points if you're just using the TRIANGLE class without an object of it
self
Return value:
True if the point is contained, false otherwise
Returns a random Vec2 within the triangle.
Defined in:
TRIANGLE
Parameters:
#table points
The points of the triangle, or 3 other points if you're just using the TRIANGLE class without an object of it
self
Return value:
#table:
The random Vec2
Creates a new triangle from three points.
The points need to be given as Vec2s
Defined in:
TRIANGLE
Parameters:
#table p1
The first point of the triangle
#table p2
The second point of the triangle
#table p3
The third point of the triangle
self
Return value:
The new triangle