Class: Triangle

Triangle(a, b, c)

Class representing a triangle.

Constructor

new Triangle(a, b, c)

Create a triangle.

Parameters:
Name Type Description
a Vector
b Vector
c Vector
Source:

Classes

Triangle

Methods

getCentroid() → {Vector}

Find the centroid of a Triangle.

Source:
Returns:
  • The centroid of the Triangle.
Type
Vector

getMidpoints() → {Array.<Vector>}

Find the midpoints of a Triangle.

Source:
Returns:
  • An array of Vectors of midpoints of the Triangle edges.
Type
Array.<Vector>

lines() → {Array.<Line>}

Create an array of Lines containing a line for each side of the Triangle.

Parameters:
Name Type Attributes Description
options.stroke string <optional>
options.strokeWidth number <optional>
Source:
Returns:
  • An array of Lines that can be added to a Plot using Plot#add.
Type
Array.<Line>