Name | Type | Default | Description |
---|---|---|---|
x |
number | 0 |
The X coord of the first point. |
y |
number | 0 |
The Y coord of the first point. |
x2 |
number | 0 |
The X coord of the second point. |
y2 |
number | 0 |
The Y coord of the second point. |
x3 |
number | 0 |
The X coord of the third point. |
y3 |
number | 0 |
The Y coord of the third point. |
Implements
Members
type SHAPE_PRIMITIVE readonly
The type of the object, mainly used to avoid instanceof
checks
- Default Value:
- 'triangle'
The X coord of the first point.
- Default Value:
- 0
The X coord of the second point.
- Default Value:
- 0
The X coord of the third point.
- Default Value:
- 0
The Y coord of the first point.
- Default Value:
- 0
The Y coord of the second point.
- Default Value:
- 0
The Y coord of the third point.
- Default Value:
- 0
Methods
clone () ShapePrimitive
Creates a clone of this Triangle
Returns:
Type | Description |
---|---|
ShapePrimitive | a copy of the triangle |
Checks whether the x and y coordinates given are contained within this triangle
Name | Type | Description |
---|---|---|
x |
number |
The X coordinate of the point to test |
y |
number |
The Y coordinate of the point to test |
Returns:
Type | Description |
---|---|
boolean | Whether the x/y coordinates are within this Triangle |
Copies another triangle to this one.
Name | Type | Description |
---|---|---|
triangle |
Triangle |
The triangle to copy from. |
Returns:
Type | Description |
---|---|
this | Returns itself. |
Copies this triangle to another one.
Name | Type | Description |
---|---|---|
triangle |
Triangle |
The triangle to copy to. |
Returns:
Type | Description |
---|---|
Triangle | Returns given parameter. |
Returns the framing rectangle of the triangle as a Rectangle object
Name | Type | Attributes | Description |
---|---|---|---|
out |
Rectangle |
<optional> |
optional rectangle to store the result |
Returns:
Type | Description |
---|---|
Rectangle | The framing rectangle |
Checks whether the x and y coordinates given are contained within this triangle including the stroke.
Name | Type | Description |
---|---|---|
pointX |
number |
The X coordinate of the point to test |
pointY |
number |
The Y coordinate of the point to test |
strokeWidth |
number |
The width of the line to check |
Returns:
Type | Description |
---|---|
boolean | Whether the x/y coordinates are within this triangle |