Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Vertex

Hierarchy

Index

Constructors

constructor

  • new Vertex(x: number, y: number, index: number): Vertex

Properties

index

index: number

x

x: number

y

y: number

Static Readonly temp

temp: Vector[] = ...

Temporary vectors

Static Readonly zero

zero: Vector = ...

Zero-vector

Methods

add

clone

copy

divide

  • divide(divisor: number): Vector

divideOut

  • Divides the vector by the given divisor and sets it's value to output(original vector does not changes).

    Parameters

    • divisor: number

      The divisor

    • output: Vector

    Returns Vector

    The divided vector

length

  • length(): number

lengthSquared

  • lengthSquared(): number

neg

negOut

  • Rotates the vector by 180 degrees and sets it's value to output(original vector does not changes).

    Parameters

    Returns Vector

    A negated vector

normalise

rotate

  • rotate(angle: number): Vector

rotate270

rotate270Out

rotate90

rotate90Out

rotateOut

  • Rotates the vector by the given angle and sets it's value to output(original vector does not changes).

    Parameters

    • angle: number
    • output: Vector

    Returns Vector

    A rotated vector

scale

  • scale(scalar: number): Vector

scaleOut

  • Scales the vector by the given scalar and sets it's value to output(original vector does not changes).

    Parameters

    • scalar: number

      The scalar

    • output: Vector

    Returns Vector

    The scaled vector

set

  • set(x: number, y: number): Vector
  • Sets the coordinates of a vector to the given values.

    Parameters

    • x: number
    • y: number

    Returns Vector

    The vector

subtract

Static add

Static angle

  • angle(vectorA: Vector, vectorB?: undefined | Vector): number
  • Returns the angle between two vectors. If vectorB is undefined than returns the angle between vectorA and 'x' axis.

    Parameters

    Returns number

    The angle

Static cross

Static dist

Static distSquared

Static distSquaredToZero

  • distSquaredToZero(vectorA: Vector, vectorB: Vector): number

Static dot

Static interpolate

Static interpolateT

Static lineSegmentsIntersection

Static lineSegmentsIntersectionFraction

Static side

  • Returns true if the 'c' is on the left side of the line segment 'a-b' or false if not.

    Parameters

    Returns boolean

    True if the 'c' is on the left side of the line segment 'a-b' or false if not

Static subtract

Static zeroSide

  • Returns true if zero-vector is on the left side of the line segment 'a-b' or false if not.

    Parameters

    Returns boolean

    True if the zero-vector is on the left side of the line segment 'a-b' or false if not

Static zeroT

Generated using TypeDoc