UNPKG

sussy-util

Version:
45 lines (44 loc) 1.88 kB
import Vector3d from './Vector3d'; export default class Point3d { readonly x: number; readonly y: number; readonly z: number; /** * Creates a new Point3d instance. * @param {number} x - The x-coordinate of the point. * @param {number} y - The y-coordinate of the point. * @param {number} z - The z-coordinate of the point. */ constructor(x: number, y: number, z: number); /** * Calculates the distance between this point and another point in 3D space. * @param {Point3d} other - The other point to calculate the distance to. * @returns {number} The distance between the two points. */ distanceTo(other: Point3d): number; /** * Calculates the slope between this point and another point in 3D space. * @param {Point3d} other - The other point to calculate the slope to. * @returns {number} The slope between the two points. */ slopeTo(other: Point3d): number; /** * Calculates the midpoint between this point and another point in 3D space. * @param {Point3d} other - The other point to calculate the midpoint to. * @returns {Point3d} The midpoint between the two points. */ midpointTo(other: Point3d): Point3d; /** * Creates a Vector3d object from this point to the given point. * @param {Point3d} other - The point to create a vector towards. * @returns {Vector3d} A Vector3d object representing the vector from this point to the given point. */ vectorTo(other: Point3d): Vector3d; /** * Calculates the angle in degrees between two vectors formed by three points (this point, p1, and p2). * @param {Point3d} p1 - The second point. * @param {Point3d} p2 - The third point. * @returns {number} The angle in degrees between the two vectors. */ angleBetween(p1: Point3d, p2: Point3d): number; }