Class Vector3d

Represents the 3d vector in three-dimensional space.

Hierarchy

  • Vector3d

Constructors

  • Initializes a new instance of a vector, using its three components.

    Parameters

    • x: number
    • y: number
    • z: number

    Returns Vector3d

Properties

X: number

Gets or sets the X (first) component of the vector.

Y: number

Gets or sets the Y (second) component of the vector.

Z: number

Gets or sets the Z (third) component of the vector.

XAxis: Vector3d = ...

Gets the value of the vector with components 1,0,0.

YAxis: Vector3d = ...

Gets the value of the vector with components 0,1,0.

ZAxis: Vector3d = ...

Gets the value of the vector with components 0,0,1.

Zero: Vector3d = ...

Gets the value of the vector with components 0,0,0.

Accessors

  • get IsUnitVector(): boolean
  • Gets a value indicating whether or not this is a unit vector. A unit vector has length 1.

    Returns boolean

  • get IsZero(): boolean
  • Gets a value indicating whether the X, Y, and Z values are all equal to 0.0.

    Returns boolean

  • get Length(): number
  • Computes the length (or magnitude, or size) of this vector.

    Returns number

Methods

  • Add a vector to this vector and returns a new vector.

    Returns

    A new vector that is the sum of this and vector.

    Parameters

    Returns Vector3d

  • Add a point to this vector and returns a new point.

    Returns

    A new point that is the sum of this and vector.

    Parameters

    Returns Point3d

  • cross product of this vector and other vector

    Parameters

    • other: Vector3d

      Another vector to cross product with.

    Returns Vector3d

  • Computes distance to another point.

    Parameters

    Returns number

  • Divides this vector by a factor and returns a new vector.

    Returns

    A new vector

    Parameters

    • factor: number

      the factor to divide this vector by.

    Returns Vector3d

  • dot product of this vector and other vector

    Parameters

    • other: Vector3d

      Another vector to dot product with.

    Returns number

  • Determines whether it equials to other vector.

    Parameters

    • other: Vector3d

      Another vector to compare.

    Returns boolean

  • Get an arbitrary vector perpendicular to this vector

    Returns Vector3d

  • Determines whether a vector is perpendicular to another vector

    Parameters

    • other: Vector3d

      Another vector to compare.

    Returns boolean

  • Determines whether a vector is very short.

    Returns

    Parameters

    • tolerance: number = Open3d.EPSILON

      A nonzero value used as the coordinate zero tolerance.

    Returns boolean

  • Multiplies this vector by a factor and returns a new vector.

    Returns

    A new vector

    Parameters

    • factor: number

      the factor to multiply this vector by.

    Returns Vector3d

  • return a reversed vector

    Returns Vector3d

  • Subtract a vector from this vector and returns a new vector.

    Returns

    A new vector

    Parameters

    Returns Vector3d

  • Transforms the vector and return a new vector The transformation matrix acts on the left of the vector; i.e., result = transformation * vector

    Parameters

    • transformation: Transform

      Transformation matrix to apply.

    Returns Vector3d

  • return a unitized vector

    Returns Vector3d

  • Compute the angle between two vectors.

    Returns

    The angle between this and other in radians.

    Parameters

    • other: Vector3d

      Another vector to compare.

    Returns number

  • Rotates this vector around a given axis.

    Parameters

    • angle: number

      Angle of rotation (in radians).

    • axis: Vector3d

      Axis of rotation.

    Returns Vector3d

  • override toString

    Returns string

  • Sums up a vector to a point and returns a new point.

    Returns

    The new point from the addition of vector and point.

    Parameters

    Returns Point3d

  • Initializes a new instance of a vector, copying the three components from the three coordinates of a point.

    Parameters

    Returns Vector3d

  • Initializes a new instance of a vector, copying the three components from a vector.

    Parameters

    Returns Vector3d

  • Computes the cross product (or vector product, or exterior product) of two vectors. This operation is not commutative.

    Returns

    A new vector that is perpendicular to both a and b, has Length == a.Length * b.Length * sin(theta) where theta is the angle between a and b. The resulting vector is oriented according to the right hand rule.

    Parameters

    Returns Vector3d

  • Computes distance between two points.

    Parameters

    Returns number

  • Divides a Vector3d by a number, having the effect of shrinking it.

    Returns

    A new vector that is componentwise divided by t.

    Parameters

    • vector: Vector3d

      A vector.

    • t: number

      A number.

    Returns Vector3d

  • returning the dot product of two vectors

    Parameters

    Returns number

  • Determines whether two vectors have the same value.

    Returns

    true if vector has the same coordinates as this; otherwise false.

    Parameters

    Returns boolean

  • Interpolate between two points/vectors.

    Returns

    A new vector that is the linear interpolation between a and b at t.

    Parameters

    Returns Vector3d

  • Determines whether a vector is perpendicular to another vector

    Returns

    true if vectors form Pi-radians (90-degree) angles with each other; otherwise false.

    Parameters

    Returns boolean

  • Multiplies a vector by a number, having the effect of scaling it.

    Returns

    A new vector that is the original vector coordinatewise multiplied by t.

    Parameters

    • vector: Vector3d

      A vector.

    • t: number

      A number.

    Returns Vector3d

  • Compute the angle between two vectors.

    Returns

    The angle between a and b in radians.

    Parameters

    • a: Vector3d

      First vector for angle.

    • b: Vector3d

      Second vector for angle.

    • Optional reference: Vector3d | Plane

      (optional) Reference direction when positive angle is required. If not provided, the angle is the smallest one (commutative).

    Returns number

Generated using TypeDoc