Options
All
• Public
• Public/Protected
• All

# @gamestdio/mathf

## Variables

### FULL_ANGLE

FULL_ANGLE: 360 = 360

### GAMMA_TO_LINEAR

GAMMA_TO_LINEAR: 2.2 = 2.2

### IS_INTEGER

IS_INTEGER: 0.5 = 0.5

### LINEAR_TO_GAMMA

LINEAR_TO_GAMMA: 0.45454545 = 0.45454545

### STRAIGHT_ANGLE

STRAIGHT_ANGLE: 180 = 180

deg2Rad: number = Math.PI * 2 / FULL_ANGLE

rad2Deg: number = FULL_ANGLE / (Math.PI * 2)

## Functions

### approximately

• approximately(f1: number, f2: number): boolean

### clamp

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

### clamp01

• clamp01(value: number): number

### closestPowerOfTwo

• closestPowerOfTwo(value: number): number

### closestPowerOfTwoLong

• closestPowerOfTwoLong(value: number): number

### deltaAngle

• deltaAngle(current: number, target: number): number

### gammaToLinearSpace

• gammaToLinearSpace(value: number): number

### inverseLerp

• inverseLerp(a: number, b: number, value: number): number

### isPowerOfTwo

• isPowerOfTwo(value: number): boolean

### lerp

• lerp(a: number, b: number, t: number): number

### lerpAngle

• lerpAngle(a: number, b: number, t: number): number

### lerpUnclamped

• lerpUnclamped(a: number, b: number, t: number): number

### linearToGammaSpace

• linearToGammaSpace(value: number): number

### moveTowards

• moveTowards(current: number, target: number, maxDelta: number): number

### moveTowardsAngle

• moveTowardsAngle(current: number, target: number, maxDelta: number): void
• TODO: Same as MoveTowards but makes sure the values interpolate correctly when they wrap around 360 degrees

see

http://docs.unity3d.com/ScriptReference/Mathf.MoveTowardsAngle.html

deprecated

### nextPowerOfTwo

• nextPowerOfTwo(value: number): number

### pingPong

• pingPong(t: number, length: number): number

### repeat

• repeat(t: number, length: number): number

### round

• round(f: number): number

### sign

• sign(f: number): 1 | -1

### smoothDamp

• smoothDamp(current: number, target: number, currentVelocity: number, smoothTime: number, maxSpeed: number, deltaTime: number): void
• TODO: Gradually changes a value towards a desired goal over time

see

http://docs.unity3d.com/ScriptReference/Mathf.SmoothDamp.html

deprecated

### smoothDampAngle

• smoothDampAngle(current: number, target: number, currentVelocity: number, smoothTime: number, maxSpeed: number, deltaTime: number): void
• TODO: Gradually changes an angle given in degrees towards a desired goal angle over time

see

http://docs.unity3d.com/ScriptReference/Mathf.SmoothDampAngle.html

### smoothStep

• smoothStep(a: number, b: number, t: number): void

### toInt

• toInt(value: number): number

#### Returns number

Generated using TypeDoc