Hierarchy (view full)

Constructors

Properties

u: number
v: number
x: number
y: number
z: number

Methods

  • Calculates the angle between this point (as a vector) and another point.

    Parameters

    Returns number

    The angle between the two vectors in radians.

  • Calculates the angle between this point (as a vector) and another point.

    Parameters

    Returns number

    The angle between the two vectors in radians.

  • Calculates the cross product of this point (as a vector) and another point.

    Parameters

    Returns void

  • Calculates the distance between this point and another point.

    Parameters

    Returns number

    The distance between the two points.

  • Calculates the dot product of this point (as a vector) and another point.

    Parameters

    Returns number

    The dot product.

  • Normalizes the point, making it a unit vector with length 1.

    Returns boolean

    True if the normalization was successful, false otherwise (if the length is 0).

  • Projects the point onto a 2D plane given the view parameters.

    Parameters

    • viewWidth: number

      The width of the view.

    • viewHeight: number

      The height of the view.

    • fov: number

      The field of view.

    • viewDistance: number

      The view distance.

    Returns Point3D

    A new Point3D representing the projected point.

  • Rotates the point around the X-axis by the given angle.

    Parameters

    • angle: number

      The angle in degrees.

    Returns Point3D

    A new Point3D representing the rotated point.

  • Rotates the point around the Y-axis by the given angle.

    Parameters

    • angle: number

      The angle in degrees.

    Returns Point3D

    A new Point3D representing the rotated point.

  • Rotates the point around the Z-axis by the given angle.

    Parameters

    • angle: number

      The angle in degrees.

    Returns Point3D

    A new Point3D representing the rotated point.

  • Scales the point's coordinates by the given scale factor.

    Parameters

    • scale: number

      The scale factor.

    Returns void