MathUtils
Overview
MathUtils is a class in Aspose.3D FOSS for TypeScript.
MathUtils.toDegree converts a radian Vector3 to degrees and returns a Vector3.
This class declares 13 methods for MathUtils objects in TypeScript programs.
Available methods include: calcNormal, clamp, findIntersection, pointInsideTriangle, rayIntersect, toDegree, toRadian.
Public members are accessible to any TypeScript application after installing the Aspose.3D FOSS for TypeScript package.
Methods
| Signature | Description |
|---|---|
toDegree(radian: Vector3) → Vector3 | Converts three radian components (x,y,z) to degrees and returns a Vector3 |
toDegree(radian: number) → number | Calls toDegree(radian) on this MathUtils instance. |
toDegree(x: number, y: number, z: number) → Vector3 | Calls toDegree(x, y, z) on this MathUtils instance. |
toDegree() → any | |
toRadian(degree: Vector3) → Vector3 | Converts three degree components (x,y,z) to radians and returns a Vector3 |
toRadian(degree: number) → number | Calls toRadian(degree) on this MathUtils instance. |
toRadian(x: number, y: number, z: number) → Vector3 | Calls toRadian(x, y, z) on this MathUtils instance. |
toRadian() → any | |
calcNormal(points: Vector3[]) → Vector3 | Computes the surface normal of a polygon defined by an array of Vector3 points |
findIntersection(p0: Vector2, d0: Vector2, p1: Vector2, d1: Vector2, results: Vector2[]) → number | Computes the intersection of two 2D lines, stores results, and returns the count |
pointInsideTriangle(p: Vector2, p0: Vector2, p1: Vector2, p2: Vector2) → boolean | Determines whether a 2D point lies inside the triangle formed by three vertices |
rayIntersect(origin: Vector2, dir: Vector2, a: Vector2, b: Vector2) → Vector2 | null | Finds the intersection of a ray and a line segment, returning the point or null |
clamp(val: number, min: number, max: number) → number | Restricts a numeric value to the inclusive range defined by min and max |