The class representing a point in 3-dimensional space.

Hierarchy (View Summary)

Constructors

Properties

x: number

X coordinate of the vector

y: number

Y coordinate of the vector

z: number

Z coordinate of the vector

NEGATIVE_X_AXIS: Readonly<AcGeVector3d>

Negative X-Axis

NEGATIVE_Y_AXIS: Readonly<AcGeVector3d>

Negative Y-Axis

NEGATIVE_Z_AXIS: Readonly<AcGeVector3d>

Negative Z-Axis

X_AXIS: Readonly<AcGeVector3d>

X-Axis

Y_AXIS: Readonly<AcGeVector3d>

Y-Axis

Z_AXIS: Readonly<AcGeVector3d>

Z-Axis

Methods

  • Returns Generator<number, void, unknown>

  • Add the specified 3d vector to this vector.

    Parameters

    Returns this

    Return this vector

  • Add the scalar value s to this vector's x, y and z values.

    Parameters

    • s: number

      Input a scalar value

    Returns this

    Return this vector

  • Add the multiple of v and s to this vector.

    Parameters

    Returns this

    Return this vector

  • Return the angle between this vector and vector v in radians.

    Parameters

    Returns number

    Return the angle between this vector and vector v in radians.

  • Apply a rotation specified by an axis and an angle to this vector.

    Parameters

    • axis: AcGeVector3dLike

      Input a normalized Vector3.

    • angle: number

      Input an angle in radians.

    Returns this

    Return this vector

  • Apply euler transform to this vector by converting the Euler object to a Quaternion and applying.

    Parameters

    Returns this

    Return this vector

  • Multiplies this vector (with an implicit 1 in the 4th dimension) by m, and divides by perspective.

    Parameters

    Returns this

    Return this vector

  • Multiply this vector by normal matrix m and normalizes the result.

    Parameters

    Returns this

    Return this vector

  • The x, y and z components of this vector are rounded up to the nearest integer value.

    Returns this

    Return this vector

  • If this vector's x, y or z value is greater than the max vector's x, y or z value, it is replaced by the corresponding value. If this vector's x, y or z value is less than the min vector's x, y or z value, it is replaced by the corresponding value.

    Parameters

    Returns this

    Return this vector

  • If this vector's length is greater than the max value, the vector will be scaled down so its length is the max value. If this vector's length is less than the min value, the vector will be scaled up so its length is the min value.

    Parameters

    • min: number

      Input the minimum value the length will be clamped to

    • max: number

      Input the maximum value the length will be clamped to

    Returns this

    Return this vector

  • If this vector's x, y or z values are greater than the max value, they are replaced by the max value. If this vector's x, y or z values are less than the min value, they are replaced by the min value.

    Parameters

    • minVal: number

      Input the minimum value the components will be clamped to

    • maxVal: number

      Input the maximum value the components will be clamped to

    Returns this

    Return this vector

  • Return a new vector3 with the same x, y and z values as this one.

    Returns AcGeVector3d

    Return a new vector3 with the same x, y and z values as this one.

  • Copy the values of the passed vector3's x, y and z properties to this vector3.

    Parameters

    Returns this

    Return this vector

  • Set this vector to cross product of itself and v.

    Parameters

    Returns this

    Return this vector

  • Compute the distance from this vector to v.

    Parameters

    Returns number

    Return the distance from this vector to v

  • Compute the squared distance from this vector to v. If you are just comparing the distance with another distance, you should compare the distance squared instead as it is slightly more efficient to calculate.

    Parameters

    Returns number

    Return the squared distance from this vector to v

  • Divide this vector by scalar s.

    Parameters

    • scalar: number

      Input a scalar value

    Returns this

    Return this vector

  • Calculate the dot product of this vector and v.

    Parameters

    Returns number

    Return the dot product of this vector and v

  • Return true if the components of this vector and v are strictly equal; false otherwise.

    Parameters

    Returns boolean

    Return true if the components of this vector and v are strictly equal; false otherwise.

  • The components of this vector are rounded down to the nearest integer value.

    Returns this

    Return this vector

  • Set this vector's x value to be array[ offset + 0 ], y value to be array[ offset + 1 ] and z value to be array[ offset + 2 ].

    Parameters

    • array: number[]

      Input the source array.

    • Optionaloffset: number

      (optional) Input offset into the array. Default is 0.

    Returns this

    Return this vector

  • Return vector component by index - 0, 1 or 2.

    • If index equals 0 returns the x value.
    • If index equals 1 returns the y value.
    • If index equals 2 returns the z value.

    Parameters

    • index: number

      Input index value - 0, 1 or 2.

    Returns number

    Return vector component with the specified index

  • Return true if vec is parallel to this vector

    Parameters

    Returns boolean

    Return true if vec is parallel to this vector

  • Compute the Euclidean length (straight-line length) from (0, 0, 0) to (x, y, z).

    Returns number

    Return the Euclidean length (straight-line length) from (0, 0, 0) to (x, y, z).

  • Compute the square of the Euclidean length (straight-line length) from (0, 0, 0) to (x, y, z). If you are comparing the lengths of vectors, you should compare the length squared instead as it is slightly more efficient to calculate.

    Returns number

    Return the square of the Euclidean length

  • Linearly interpolate between this vector and v, where alpha is the percent distance along the line - alpha = 0 will be this vector, and alpha = 1 will be v.

    Parameters

    • v: AcGeVector3dLike

      Input vector to interpolate towards

    • alpha: number

      Input interpolation factor, typically in the closed interval [0, 1]

    Returns this

    Return this vector

  • Set this vector to be the vector linearly interpolated between v1 and v2 where alpha is the percent distance along the line connecting the two vectors - alpha = 0 will be v1, and alpha = 1 will be v2.

    Parameters

    • v1: AcGeVector3dLike

      Input the starting vector

    • v2: AcGeVector3dLike

      Input vector to interpolate towards

    • alpha: number

      Input interpolation factor, typically in the closed interval [0, 1].

    Returns this

    Return this vector

  • Compute the Manhattan distance from this vector to v.

    Parameters

    Returns number

    Return the Manhattan distance from this vector to v

  • Compute the Manhattan length of this vector.

    Returns number

    Return the Manhattan length of this vector.

  • If this vector's x, y or z value is less than v's x, y or z value, replace that value with the corresponding max value.

    Parameters

    Returns this

    Return this vector

  • If this vector's x, y or z value is greater than v's x, y or z value, replace that value with the corresponding min value.

    Parameters

    Returns this

    Return this vector

  • Multiply this vector by scalar s.

    Parameters

    • scalar: number

      Input a scalar value

    Returns this

    Return this vector

  • Inverts this vector - i.e. sets x = -x, y = -y and z = -z.

    Returns this

    Return this vector

  • Convert this vector to a unit vector - that is, sets it equal to a vector with the same direction as this one, but length 1.

    Returns this

    Return this vector

  • Project this vector onto a plane by subtracting this vector projected onto the plane's normal from this vector.

    Parameters

    • planeNormal: AcGeVector3d

      Input a vector representing a plane normal.

    Returns this

    Return this vector

  • Set each component of this vector to a pseudo-random value between 0 and 1, excluding 1.

    Returns this

    Return this vector

  • Set this vector to a uniformly random point on a unit sphere.

    Returns this

    Return this vector

  • Reflect this vector off of plane orthogonal to normal. Normal is assumed to have unit length.

    Parameters

    Returns this

    Return this vector

  • The components of this vector are rounded to the nearest integer value.

    Returns this

    Return this vector

  • The components of this vector are rounded towards zero (up if negative, down if positive) to an integer value.

    Returns this

    Return this vector

  • Sets the x, y and z components of this vector.

    Parameters

    • x: number

      Input the x components of this vector.

    • y: number

      Input the y components of this vector.

    • z: number

      Input the z components of this vector.

    Returns this

    Return this vector

  • Set vector component by index - 0, 1 or 2.

    • If index equals 0 set x to value.
    • If index equals 1 set y to value.
    • If index equals 2 set z to value

    Parameters

    • index: number

      Input index value - 0, 1 or 2.

    • value: number

      Input value to be set

    Returns this

    Return this vector

  • Set this vector's x, y and z components from index column of matrix.

    Parameters

    • m: AcGeMatrix2d

      Input one 3x3 matrix

    • index: number

      Input column index

    Returns this

    Return this vector

  • Set this vector's x, y and z components from index column of matrix.

    Parameters

    • m: AcGeMatrix3d

      Input one 4x4 matrix

    • index: number

      Input column index

    Returns this

    Return this vector

  • Set this vector to the position elements of the transformation matrix m.

    Parameters

    Returns this

    Return this vector

  • Set this vector to the scale elements of the transformation matrix m.

    Parameters

    Returns this

    Return this vector

  • Set this vector to a vector with the same direction as this one, but length l.

    Parameters

    • l: number

      Input a lenght value

    Returns this

    Return this vector

  • Set the x, y and z values of this vector both equal to scalar.

    Parameters

    • scalar: number

      Input a scalar value

    Returns this

    Return this vector

  • Replace this vector's x value with x.

    Parameters

    • x: number

      Input the new vector's x value

    Returns this

    Return this vector

  • Replace this vector's y value with y.

    Parameters

    • y: number

      Input the new vector's y value

    Returns this

    Return this vector

  • Replace this vector's z value with z.

    Parameters

    • z: number

      Input the new vector's z value

    Returns this

    Return this vector

  • Subtract v from this vector.

    Parameters

    Returns this

    Return this vector

  • Subtract s from this vector's x, y and z components.

    Parameters

    • s: number

      Input a number value to substract

    Returns this

    Return this vector

  • Return an array [x, y, z], or copies x, y and z into the provided array.

    Parameters

    • Optionalarray: number[] | Float32Array

      (optional) Input array to store this vector to. If this is not provided a new array will be created.

    • Optionaloffset: number

      (optional) Input optional offset into the array.

    Returns number[] | Float32Array

    Return an array [x, y, z], or copies x, y and z into the provided array.

  • Transforms the direction of this vector by a matrix (the upper left 3 x 3 subset of a m) and then normalizes the result.

    Parameters

    Returns this

  • Convert one point array to one number array

    Parameters

    • array: AcGePoint3d[]

      Input one point array

    • OptionalincludeZ: boolean

      Include z cooridinate in returned number array if it is true.

    Returns number[]

    Return converted number array