Options
All
  • Public
  • Public/Protected
  • All
Menu
classdesc

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

abstract
requires

UID

requires

Vertex

requires

XYCoords

Type parameters

Hierarchy

Index

Constructors

constructor

Properties

a

member

{Vertex}

memberof

VertTuple

instance

b

member

{Vertex}

memberof

VertTuple

instance

Private factory

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

The factory is used by the clone method.

Type declaration

Readonly uid

uid: UID

The UID of this drawable object.

member

{UID}

memberof

VertTuple

instance
readonly

Methods

add

  • Add the given vertex to this line's end points.

    method

    add

    instance
    memberof

    VertTuple

    Parameters

    • amount: XYCoords

      The amount (x,y) to add.

    Returns VertTuple<T>

    this

angle

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

    method

    angle

    instance
    memberof

    VertTuple

    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

clone

  • clone(): T
  • Create a deep clone of this instance.

    method

    cloneLine

    instance
    memberof

    VertTuple

    Returns T

    A type safe clone if this instance.

colinear

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

    The constant Vertex.EPSILON is used for tolerance.

    method

    colinear

    instance
    memberof

    VertTuple

    Parameters

    Returns boolean

    true if both lines are co-linear.

denominator

  • Get the denominator of this and the given line.

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

    method

    denominator

    instance
    memberof

    VertTuple

    Parameters

    Returns number

getClosestPoint

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

    method

    getClosestPoint

    instance
    memberof

    VertTuple

    Parameters

    • p: Vertex

      The point (vertex) to measre the distance to.

    Returns Vertex

    The point on the line that is closest to p.

getClosestT

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

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

    name

    getClosetT

    method

    getClosestT

    instance
    memberof

    VertTuple

    Parameters

    • p: XYCoords

      The point (vertex) to measure the distance to.

    Returns number

    The line position t of minimal distance to p.

hasPoint

  • hasPoint(point: XYCoords, insideBoundsOnly?: boolean): boolean
  • Check if the given point is located on this line. Optionally also check if that point is located between point a and b.

    method

    hasPoint

    instance
    memberof

    VertTuple

    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.

length

  • length(): number
  • Get the length of this line.

    method

    length

    instance
    memberof

    VertTuple

    Returns number

moveTo

  • Move this line to a new location.

    method

    moveTo

    instance
    memberof

    VertTuple

    Parameters

    • newA: Vertex

      The new desired location of 'a'. Vertex 'b' will be moved, too.

    Returns VertTuple<T>

    this

normalize

pointDistance

  • pointDistance(p: Vertex): number
  • The the minimal distance between this line and the specified point.

    method

    pointDistance

    instance
    memberof

    VertTuple

    Parameters

    • p: Vertex

      The point (vertex) to measre the distance to.

    Returns number

    The absolute minimal distance.

scale

  • Scale this line by the given factor.

    method

    scale

    instance
    memberof

    VertTuple

    Parameters

    • factor: number

      The factor for scaling (1.0 means no scale).

    Returns VertTuple<T>

    this

setLength

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

    method

    setLength

    memberof

    VertTuple

    Parameters

    • length: number

      The desired length.

    Returns VertTuple<T>

    this (for chaining)

sub

  • Substract the given vertex from this line's end points.

    method

    sub

    instance
    memberof

    VertTuple

    Parameters

    • amount: XYCoords

      The amount (x,y) to substract.

    Returns VertTuple<T>

    this

toString

  • toString(): string
  • Create a string representation of this line.

    method

    totring

    instance
    memberof

    VertTuple

    Returns string

    The string representing this line.

vertAt

  • 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).
    method

    vertAt

    instance
    memberof

    VertTuple

    Parameters

    • t: number

      The position scalar.

    Returns Vertex

    The vertex a position t.

Object literals

Static Private vtutils

vtutils: object

dist2

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Private property
  • Private method
  • Static property
  • Static method

Generated using TypeDoc