Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Point

Represents a point with x, y, and z coordinates.

Hierarchy

  • Point

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Point(x?: number, y?: number, z?: number): Point
  • Instantiates a new instance of a Point object.

    Parameters

    • x: number = 0

      X coordinate of the point.

    • y: number = 0

      Y coordinate of the point.

    • z: number = 0

      Z coordinate of the point.

    Returns Point

Properties

x

x: number

y

y: number

z

z: number

Methods

Static angle

  • Calculates the angle (in degrees or radians) of the line that connects two points.

    Parameters

    • p1: IPoint

      First point.

    • p2: IPoint

      Second point.

    • radians: boolean = false

      Whether to return the result in radians.

    Returns number

    The angle (in degrees or radians) of the line that connects the two points.

Static clone

  • Creates a clone of a given IPoint object.

    Parameters

    Returns IPoint

    A copy of the given IPoint object.

Static copy

Static distance

  • Calculates the distance between two IPoint objects.

    Parameters

    Returns number

    The distance between the two points.

Static interpolate

  • Calculates an IPoint by performing a linear interpolation between two IPoint objects.

    Parameters

    • p1: IPoint

      First point.

    • p2: IPoint

      Second point.

    • t: number

      Coefficient that corresponds to the relative distance of the result to the first point. Zero corresponds to the first point, one to the second point.

    Returns IPoint

    A point between the two given points.

Generated using TypeDoc