ixfx
    Preparing search index...

    Namespace Triangles

    Triangle processing.

    Helpers for creating:

    There are sub-modules for dealing with particular triangles:

    Calculations

    Conversions

    Comparisons

    Namespaces

    Equilateral

    Functions for working with equilateral triangles, defined by length

    Isosceles

    Functions for working with right-angled triangles, defined by two of three edges

    Functions

    angles

    Return the three interior angles of the triangle, in radians.

    anglesDegrees

    Returns the three interior angles of the triangle, in degrees

    apply

    Applies fn to each of a triangle's corner points, returning the result.

    area

    Calculates the area of a triangle

    barycentricCoord

    Returns the Barycentric coordinate of a point within a triangle

    barycentricToCartestian

    Convert Barycentric coordinate to Cartesian

    bbox

    Returns the bounding box that encloses the triangle.

    centroid

    Returns simple centroid of triangle

    corners

    Returns the corners (vertices) of the triangle as an array of points

    edges

    Returns the edges (ie sides) of the triangle as an array of lines

    equilateralFromVertex

    Returns a triangle anchored at origin with a given length and angleRadian. The origin will be point b of the triangle, and the angle will be the angle for b.

    fromFlatArray

    Returns a triangle from a set of coordinates in a flat array form: [xA, yA, xB, yB, xC, yC]

    fromPoints

    Returns a triangle from an array of three points

    fromRadius

    Returns an equilateral triangle centered at the origin.

    guard

    Throws an exception if the triangle is invalid

    innerCircle

    Returns the largest circle enclosed by triangle t.

    intersectsPoint

    Returns true if point is within or on the boundary of triangle

    isAcute

    Returns true if triangle is actue: all interior angles less than 90 degrees

    isEmpty

    Returns true if triangle is empty

    isEqual

    Returns true if the two parameters have equal values

    isEquilateral

    Returns true if it is an equilateral triangle

    isIsosceles

    Returns true if it is an isosceles triangle

    isOblique

    Returns true if triangle is oblique: No interior angle is 90 degrees

    isObtuse

    Returns true if triangle is obtuse: at least one interior angle is greater than 90 degrees

    isPlaceholder

    Returns true if triangle is a placeholder

    isRightAngle

    Returns true if at least one interior angle is 90 degrees

    isTriangle

    Returns true if the parameter appears to be a valid triangle

    lengths

    Returns the lengths of the triangle sides

    outerCircle

    Returns the largest circle touching the corners of triangle t.

    perimeter

    Calculates perimeter of a triangle

    rotate

    Returns a triangle that is rotated by angleRad. By default it rotates around its center but an arbitrary origin point can be provided.

    rotateByVertex

    Rotates the vertices of the triangle around one point (by default, b), returning as a new object.

    toFlatArray

    Returns the coordinates of triangle in a flat array form: [xA, yA, xB, yB, xC, yC]

    Type Aliases

    BarycentricCoord
    Triangle

    Variables

    Empty

    A triangle consisting of three empty points (Points.Empty)

    Placeholder

    A triangle consisting of three placeholder points (Points.Placeholder)