Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Vector

Hierarchy

  • Vector

Index

Constructors

constructor

  • new Vector(...values: number[]): Vector

Properties

Readonly values

values: number[]

Accessors

dim

  • get dim(): number

length

  • get length(): number

normalized

w

  • get w(): number
  • set w(value: number): void

x

  • get x(): number
  • set x(value: number): void

xy

xyz

xz

y

  • get y(): number
  • set y(value: number): void

yz

z

  • get z(): number
  • set z(value: number): void

Methods

add

clone

cross

div

dot

equals

  • equals(otherVec: Vector): boolean

mul

  • multiply vector with scalar

    Parameters

    • value: number

      scalar

    Returns Vector

    multiplication result

set

  • set(...values: number[]): Vector

sub

toArray

  • toArray(): number[]

toString

  • toString(): string

Static fromArray

  • fromArray(arr: number[]): Vector

Static fromNumber

  • fromNumber(n: number, dim: number): Vector
  • Create vector with x = y = n

    Parameters

    • n: number

      the number

    • dim: number

      the dimension

    Returns Vector

Generated using TypeDoc