---
Product: Aspose.3D
Platform: typescript
Page Type: reference
Canonical URL: https://reference.aspose.org/3d/typescript/MathUtils
---

# 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 provides 7 methods for working with MathUtils objects in Typescript programs.
Available methods include: `calcNormal`, `clamp`, `findIntersection`, `pointInsideTriangle`, `rayIntersect`, `toDegree`, `toRadian`.
All public members are accessible to any Typescript application after installing the Aspose.3D FOSS for Typescript package.

## Description

`MathUtils` is a class in the Aspose.3D FOSS library for TypeScript that exposes 13 methods and 0 properties for programmatic use.

## Methods

| Signature | Description |
|-----------|-------------|
| `toDegree(radian: Vector3)` → `Vector3` | Converts three radian components (x,y,z) to degrees and returns a Vector3 |
| `toDegree(radian: number)` → `number` |  |
| `toDegree(x: number, y: number, z: number)` → `Vector3` |  |
| `toDegree()` → `any` |  |
| `toRadian(degree: Vector3)` → `Vector3` | Converts three degree components (x,y,z) to radians and returns a Vector3 |
| `toRadian(degree: number)` → `number` |  |
| `toRadian(x: number, y: number, z: number)` → `Vector3` |  |
| `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 |

## See Also

- [Aspose.3D — Enterprise API Reference](https://reference.aspose.com/3d/)