Classdesc

An abstract base classes for vertex tuple constructs, like Lines or Vectors.

Abstract

Requires

UID

Requires

Vertex

Requires

XYCoords

Type Parameters

Hierarchy (view full)

Constructors

Properties

Member

Memberof

VertTuple

Instance

Member

Memberof

VertTuple

Instance

factory: ((a, b) => T)

The factory is used by the clone method.

Type declaration

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

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

    • Optional epsilon: number

      [optional] A tolerance.

    Returns boolean

    True if the given point is on this line.

    Method

    hasPoint

    Instance

    Memberof

    VertTuple

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

    Parameters

    • p: XYCoords

      The point (vertex) to measre the distance to.

    Returns number

    The absolute minimal distance.

    Method

    pointDistance

    Instance

    Memberof

    VertTuple

  • Set the length of this vector to the given amount. This only works if this vector is not a null vector.

    Parameters

    • length: number

      The desired length.

    Returns VertTuple<T>

    this (for chaining)

    Method

    setLength

    Memberof

    VertTuple

  • 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