Class Vector3d

a generic 3D Vector Object

Constructors

constructor

Properties

x

x: number

y

y: number

z

z: number

Methods

abs

add

angle

ceil

ceilSelf

clamp

clampSelf

clone

copy

cross

distance

div

dot

equals

  • equals(...args): boolean
  • return true if this vector is equal to the given values or vector

    Parameters

    • Rest...args:
      | [number, number]
      | [number, number, number]
      | [number]
      | [Vector2d ]
      | [Vector3d ]

      other vector or vector components

    Returns boolean

    true if both vectors are equal

floor

floorSelf

length

length2

lerp

  • lerp(v, alpha): Vector3d
  • Linearly interpolate between this vector and the given one.

    Parameters

    • v: Vector3d

      other vector

    • alpha: number

      distance along the line (alpha = 0 will be this vector, and alpha = 1 will be the given one).

    Returns Vector3d

    Reference to this object for method chaining

maxV

minV

moveTowards

negate

negateSelf

normalize

onResetEvent

perp

project

projectN

rotate

  • rotate(angle, v?): Vector3d
  • Rotate this vector (counter-clockwise) by the specified angle (in radians) around the z axis

    Parameters

    • angle: number

      The angle to rotate (in radians)

    • Optionalv: XYPoint

      an optional point to rotate around (on the same z axis)

    Returns Vector3d

    Reference to this object for method chaining

scale

  • scale(x, y?, z?): Vector3d
  • Multiply this vector values by the given scalar

    Parameters

    • x: number

      x component

    • Optionaly: number = x

      y component

    • Optionalz: number = 1

      z component

    Returns Vector3d

    Reference to this object for method chaining

scaleV

set

setV

setZero

sub

to2d

toIso

toString

  • toString(): `x:${number},y:${number},z:${number}`
  • convert the object to a string representation

    Returns `x:${number},y:${number},z:${number}`

    stringified representation

Settings

Member Visibility

On This Page

AltStyle によって変換されたページ (->オリジナル) /