Mathf

More information can be found in the Unity API Reference

Constructors

Constructor

Description

Mathf()

Methods

Method

Description

ToString()

Static members

Member

Description

Deg2Rad

Epsilon

Infinity

NegativeInfinity

PI

Rad2Deg

Static methods

Method

Description

Abs(f)

Abs(value)

Acos(f)

Approximately(a, b)

Asin(f)

Atan(f)

Atan2(y, x)

Ceil(f)

CeilToInt(f)

Clamp(value, min, max)

Clamp(value, min, max)

Clamp01(value)

ClosestPowerOfTwo(value)

CorrelatedColorTemperatureToRGB(kelvin)

Cos(f)

DeltaAngle(current, target)

Exp(power)

FloatToHalf(val)

Floor(f)

FloorToInt(f)

Gamma(value, absmax, gamma)

GammaToLinearSpace(value)

HalfToFloat(val)

InverseLerp(a, b, value)

IsPowerOfTwo(value)

Lerp(a, b, t)

LerpAngle(a, b, t)

LerpUnclamped(a, b, t)

LinearToGammaSpace(value)

Log(f)

Log(f, p)

Log10(f)

Max(values)

Max(values)

Max(a, b)

Max(a, b)

Min(values)

Min(values)

Min(a, b)

Min(a, b)

MoveTowards(current, target, maxDelta)

MoveTowardsAngle(current, target, maxDelta)

NextPowerOfTwo(value)

PerlinNoise(x, y)

PingPong(t, length)

Pow(f, p)

Repeat(t, length)

Round(f)

RoundToInt(f)

Sign(f)

Sin(f)

SmoothDamp(current, target, currentVelocity, smoothTime)

SmoothDamp(current, target, currentVelocity, smoothTime, maxSpeed)

SmoothDamp(current, target, currentVelocity, smoothTime, maxSpeed, deltaTime)

SmoothDampAngle(current, target, currentVelocity, smoothTime)

SmoothDampAngle(current, target, currentVelocity, smoothTime, maxSpeed)

SmoothDampAngle(current, target, currentVelocity, smoothTime, maxSpeed, deltaTime)

SmoothStep(from, to, t)

Sqrt(f)

Tan(f)

Details

class Mathf
Mathf Mathf()
string ToString()
static const float Deg2Rad
static const float Epsilon
static const float Infinity
static const float NegativeInfinity
static const float PI
static const float Rad2Deg
static float Abs(float f)
static int Abs(int value)
static float Acos(float f)
static bool Approximately(float a, float b)
static float Asin(float f)
static float Atan(float f)
static float Atan2(float y, float x)
static float Ceil(float f)
static int CeilToInt(float f)
static float Clamp(float value, float min, float max)
static int Clamp(int value, int min, int max)
static float Clamp01(float value)
static int ClosestPowerOfTwo(int value)
static Color CorrelatedColorTemperatureToRGB(float kelvin)
static float Cos(float f)
static float DeltaAngle(float current, float target)
static float Exp(float power)
static UInt16 FloatToHalf(float val)
static float Floor(float f)
static int FloorToInt(float f)
static float Gamma(float value, float absmax, float gamma)
static float GammaToLinearSpace(float value)
static float HalfToFloat(UInt16 val)
static float InverseLerp(float a, float b, float value)
static bool IsPowerOfTwo(int value)
static float Lerp(float a, float b, float t)
static float LerpAngle(float a, float b, float t)
static float LerpUnclamped(float a, float b, float t)
static float LinearToGammaSpace(float value)
static float Log(float f)
static float Log(float f, float p)
static float Log10(float f)
static float Max(array<float> values)
static int Max(array<int> values)
static float Max(float a, float b)
static int Max(int a, int b)
static float Min(array<float> values)
static int Min(array<int> values)
static float Min(float a, float b)
static int Min(int a, int b)
static float MoveTowards(float current, float target, float maxDelta)
static float MoveTowardsAngle(float current, float target, float maxDelta)
static int NextPowerOfTwo(int value)
static float PerlinNoise(float x, float y)
static float PingPong(float t, float length)
static float Pow(float f, float p)
static float Repeat(float t, float length)
static float Round(float f)
static int RoundToInt(float f)
static float Sign(float f)
static float Sin(float f)
static float SmoothDamp(float current, float target, float currentVelocity, float smoothTime)
static float SmoothDamp(float current, float target, float currentVelocity, float smoothTime, float maxSpeed)
static float SmoothDamp(float current, float target, float currentVelocity, float smoothTime, float maxSpeed, float deltaTime)
static float SmoothDampAngle(float current, float target, float currentVelocity, float smoothTime)
static float SmoothDampAngle(float current, float target, float currentVelocity, float smoothTime, float maxSpeed)
static float SmoothDampAngle(float current, float target, float currentVelocity, float smoothTime, float maxSpeed, float deltaTime)
static float SmoothStep(float from, float to, float t)
static float Sqrt(float f)
static float Tan(float f)