Classdesc

A line consists of two vertices a and b.

This is some refactored code from my 'Morley Triangle' test
https://github.com/IkarosKappler/morleys-trisector-theorem

Requires

Vertex

Hierarchy (view full)

Implements

Constructors

Properties

Member

Memberof

VertTuple

Instance

Member

Memberof

VertTuple

Instance

className: string = "Line"

Required to generate proper CSS classes and other class related IDs.

isDestroyed: boolean

Member

isDestroyed

Memberof

VertTuple

Instance

uid: string

The UID of this drawable object.

Member

Memberof

VertTuple

Instance

vtutils: {
    dist2: ((v, w) => number);
} = ...

Type declaration

  • dist2: ((v, w) => number)

Methods

  • Get the angle between this and the passed line (in radians).

    Parameters

    • Optional line: VertTuple<any>

      (optional) The line to calculate the angle to. If null the baseline (x-axis) will be used.

    Returns number

    this

    Method

    angle

    Instance

    Memberof

    VertTuple

  • Checks if this and the given line are co-linear.

    The constant Vertex.EPSILON is used for tolerance.

    Parameters

    Returns boolean

    true if both lines are co-linear.

    Method

    colinear

    Instance

    Memberof

    VertTuple

  • Get the denominator of this and the given line.

    If the denominator is zero (or close to zero) both line are co-linear.

    Parameters

    Returns number

    Method

    denominator

    Instance

    Memberof

    VertTuple

  • This function should invalidate any installed listeners and invalidate this object. After calling this function the object might not hold valid data any more and should not be used.

    Returns void

  • Get the closest point on this line to the specified point.

    Parameters

    • p: Vertex

      The point (vertex) to measre the distance to.

    Returns Vertex

    The point on the line that is closest to p.

    Method

    getClosestPoint

    Instance

    Memberof

    VertTuple

  • Get the closest position T from this line to the specified point.

    The counterpart for this function is Line.vertAt(Number).

    Parameters

    • p: XYCoords

      The point (vertex) to measure the distance to.

    Returns number

    The line position t of minimal distance to p.

    Name

    getClosetT

    Method

    getClosestT

    Instance

    Memberof

    VertTuple

  • Check if the given point is located on this line. Optionally also check if that point is located between point a and b.

    Parameters

    • point: XYCoords

      The point to check.

    • Optional insideBoundsOnly: boolean

      If set to to true (default=false) the point must be between start and end point of the line.

    Returns boolean

    True if the given point is on this line.

    Method

    hasPoint

    Instance

    Memberof

    VertTuple

  • Get the intersection if this line and the specified line.

    Parameters

    Returns Vertex

    The intersection (may lie outside the end-points) or undefined if both lines are parallel.

    Method

    intersection

    Instance

    Memberof

    Line

  • The the minimal distance between this line and the specified point.

    Parameters

    • p: Vertex

      The point (vertex) to measre the distance to.

    Returns number

    The absolute minimal distance.

    Method

    pointDistance

    Instance

    Memberof

    VertTuple

  • Inverse this path segment (in-place) and return this same instance (useful for chaining).

    Returns Line

    This path segment instance (for chaining).

    Method

    reverse

    Memberof

    PathSegment

  • Create a string representation of this line.

    Returns string

    The string representing this line.

    Method

    totring

    Instance

    Memberof

    VertTuple

  • Get line point at position t in [0 ... 1]:

    [P(0)]=[A]--------------------[P(t)]------[B]=[P(1)]


    The counterpart of this function is Line.getClosestT(Vertex).

    Parameters

    • t: number

      The position scalar.

    Returns Vertex

    The vertex a position t.

    Method

    vertAt

    Instance

    Memberof

    VertTuple

Generated using TypeDoc