Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

  • new Vec4(x: number, y: number, z: number, h: number): Vec4
  • new Vec4(elements?: number[]): Vec4

Properties

elements

elements: number[] = []

Static N_DIMENSIONS

N_DIMENSIONS: number = 4

Accessors

Point3D

h

  • get h(): number
  • set h(val: number): void

nDimensions

  • get nDimensions(): number

serializationLabel

  • get serializationLabel(): any

x

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

y

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

z

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

Methods

L2

  • L2(): number

_setToDefault

  • _setToDefault(): void

addVector

asThreeJS

  • asThreeJS(): Vector4

clone

dot

fmax

  • fmax(): number

forEach

  • forEach(fn: (e: number, i: number) => any, context: any): void
  • Parameters

    • fn: (e: number, i: number) => any

      function to be executed on each element

        • (e: number, i: number): any
        • Parameters

          • e: number
          • i: number

          Returns any

    • context: any

      context for execution

    Returns void

getHomogenized

  • getHomogenized(): Vec4

getMapped

  • getMapped(fn: (e: number, i: number) => number, context?: any): Vec4
  • Returns a VectorType with each of its elements replaced by fn(e) where e is the corresponding element of this vector

    Parameters

    • fn: (e: number, i: number) => number

      function to be run on each element. e is the element value, and i is its index. Should return a new element.

        • (e: number, i: number): number
        • Parameters

          • e: number
          • i: number

          Returns number

    • Optional context: any

      the context for the function call. In other words, what is to be used as the 'this' variable when running the call.

    Returns Vec4

    • Vectgor of the results from running fn on each element of this.elements

getNormalized

  • getNormalized(): Vec4

getRounded

homogenize

  • homogenize(): void

inspect

  • inspect(): string

isEqualTo

  • isEqualTo(other: VectorType, tolerance?: number): boolean

minus

normalize

  • normalize(): void

plus

setElements

  • setElements(els: number[]): Vec4

sstring

  • sstring(): string

subtractVector

times

  • times(k: number): Vec4

timesElementWise

toJSON

  • toJSON(): {}

toString

  • toString(): string

Static FromPoint2DXY

Static FromVec2DXY

Static Ones

Static Random

Static Zeros

Static flatten

  • flatten(...vecs: (number | any[] | ExtendsVector)[]): number[]

Static h

Static i

Static j

Static k

Generated using TypeDoc