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

  • 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 AcGePoint3d

    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 AcGePoint3d

    Return this vector

  • 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

  • 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.

    • offset: number = 0

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

    Returns AcGePoint3d

    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

  • 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

  • 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 AcGePoint3d

    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 AcGePoint3d

    Return this vector

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

    Parameters

    • array: number[] | Float32Array = []

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

    • offset: number = 0

      (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.

  • Convert one point array to one number array

    Parameters

    • array: AcGePoint3d[]

      Input one point array

    • includeZ: boolean = true

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

    Returns number[]

    Return converted number array