A utility class containing methods you might need for math problems.

### Hierarchy

- MathUtil

## Index

### Properties

- TWO_PI

### Methods

- clamp
- deg2rad
- getNextPowerOfTwo
- intersectLineWithXYPlane
- isEquivalent
- isPointInTriangle
- max
- min
- minValues
- normalizeAngle
- rad2deg
- toFixed

## Properties

### Static Protected TWO_PI

TWO_PI: number

- Defined in lib/starling/utils/MathUtil.d.ts:9

## Methods

### Static clamp

- clamp(value: number, min: number, max: number): number

- - Defined in lib/starling/utils/MathUtil.d.ts:37

  Moves `value` into the range between `min` and `max`.

  #### Parameters

  - ##### value: number

  - ##### min: number

  - ##### max: number

  #### Returns number

### Static deg2rad

- deg2rad(deg: number): number

- - Defined in lib/starling/utils/MathUtil.d.ts:43

  Converts an angle from degrees into radians.

  #### Parameters

  - ##### deg: number

  #### Returns number

### Static getNextPowerOfTwo

- getNextPowerOfTwo(number: number): number

- - Defined in lib/starling/utils/MathUtil.d.ts:23

  Returns the next power of two that is equal to or bigger than the specified number.

  #### Parameters

  - ##### number: number

  #### Returns number

### Static intersectLineWithXYPlane

- intersectLineWithXYPlane(pointA: Vector3D, pointB: Vector3D, out?: Point): Point

- - Defined in lib/starling/utils/MathUtil.d.ts:13

  Calculates the intersection point between the xy-plane and an infinite line that is defined by two 3D points in the same coordinate system.

  #### Parameters

  - ##### pointA: Vector3D

  - ##### pointB: Vector3D

  - ##### Optional out: Point

  #### Returns Point

### Static isEquivalent

- isEquivalent(a: number, b: number, epsilon?: number): boolean

- - Defined in lib/starling/utils/MathUtil.d.ts:26

  Indicates if two float (Number) values are equal, give or take `epsilon`.

  #### Parameters

  - ##### a: number

  - ##### b: number

  - ##### Optional epsilon: number

  #### Returns boolean

### Static isPointInTriangle

- isPointInTriangle(p: Point, a: Point, b: Point, c: Point): boolean

- - Defined in lib/starling/utils/MathUtil.d.ts:17

  Calculates if the point `p` is inside the triangle `a-b-c`.

  #### Parameters

  - ##### p: Point

  - ##### a: Point

  - ##### b: Point

  - ##### c: Point

  #### Returns boolean

### Static max

- max(a: number, b: number): number

- - Defined in lib/starling/utils/MathUtil.d.ts:30

  Returns the larger of the two values. Different to the native `Math.max`, this doesn't create any temporary objects when using the AOT compiler.

  #### Parameters

  - ##### a: number

  - ##### b: number

  #### Returns number

### Static min

- min(a: number, b: number): number

- - Defined in lib/starling/utils/MathUtil.d.ts:34

  Returns the smaller of the two values. Different to the native `Math.min`, this doesn't create any temporary objects when using the AOT compiler.

  #### Parameters

  - ##### a: number

  - ##### b: number

  #### Returns number

### Static minValues

- minValues(values: Array<number>): number

- - Defined in lib/starling/utils/MathUtil.d.ts:40

  Returns the smallest value in an array.

  #### Parameters

  - ##### values: Array<number>

  #### Returns number

### Static normalizeAngle

- normalizeAngle(angle: number): number

- - Defined in lib/starling/utils/MathUtil.d.ts:20

  Moves a radian angle into the range [-PI, +PI], while keeping the direction intact.

  #### Parameters

  - ##### angle: number

  #### Returns number

### Static rad2deg

- rad2deg(rad: number): number

- - Defined in lib/starling/utils/MathUtil.d.ts:46

  Converts an angle from radians into degrees.

  #### Parameters

  - ##### rad: number

  #### Returns number

### Static toFixed

- toFixed(value: number, precision: number): string

- - Defined in lib/starling/utils/MathUtil.d.ts:48

  #### Parameters

  - ##### value: number

  - ##### precision: number

  #### Returns string

Generated using TypeDoc