Version 3.0.0.2

MathUtilities class

Namespace: Sirenix.Utilities
Assembly: Sirenix.Utilities
public static class MathUtilities
Inheritance
  • System.Object
  • MathUtilities

Methods

Abs(Vector3)
public static Vector3 Abs(this Vector3 v)
Parameters
UnityEngine.Vector3 v

Returns
UnityEngine.Vector3

Bounce(Single)
public static float Bounce(float value)
Parameters
System.Single value

Returns
System.Single

BounceEaseInFastOut(Single)
public static float BounceEaseInFastOut(float t)
Parameters
System.Single t

Returns
System.Single

Clamp(Vector2, Vector2, Vector2)
public static Vector2 Clamp(this Vector2 value, Vector2 min, Vector2 max)
Parameters
UnityEngine.Vector2 value

UnityEngine.Vector2 min

UnityEngine.Vector2 max

Returns
UnityEngine.Vector2

Clamp(Vector3, Vector3, Vector3)
public static Vector3 Clamp(this Vector3 value, Vector3 min, Vector3 max)
Parameters
UnityEngine.Vector3 value

UnityEngine.Vector3 min

UnityEngine.Vector3 max

Returns
UnityEngine.Vector3

ClampWrapAngle(Single, Single, Single)
public static float ClampWrapAngle(float angle, float min, float max)
Parameters
System.Single angle

System.Single min

System.Single max

Returns
System.Single

ComputeByteArrayHash(Byte[])
public static int ComputeByteArrayHash(byte[] data)
Parameters
System.Byte[] data

Returns
System.Int32

DiscardLeastSignificantDecimal(Double)
public static double DiscardLeastSignificantDecimal(double v)
Parameters
System.Double v

Returns
System.Double

EaseInElastic(Single, Single, Single)
public static float EaseInElastic(float value, float amplitude = 0.25F, float length = 0.6F)
Parameters
System.Single value

System.Single amplitude

System.Single length

Returns
System.Single

EaseInOut(Single)
public static float EaseInOut(float t)
Parameters
System.Single t

Returns
System.Single

EaseOutElastic(Single, Single, Single)
public static float EaseOutElastic(float value, float amplitude = 0.25F, float length = 0.6F)
Parameters
System.Single value

System.Single amplitude

System.Single length

Returns
System.Single

Fract(Single)
public static float Fract(float value)
Parameters
System.Single value

Returns
System.Single

Fract(Vector2)
public static Vector2 Fract(Vector2 value)
Parameters
UnityEngine.Vector2 value

Returns
UnityEngine.Vector2

Fract(Vector3)
public static Vector3 Fract(Vector3 value)
Parameters
UnityEngine.Vector3 value

Returns
UnityEngine.Vector3

Hermite(Single, Single, Single)
public static float Hermite(float start, float end, float t)
Parameters
System.Single start

System.Single end

System.Single t

Returns
System.Single

Hermite01(Single)
public static float Hermite01(float t)
Parameters
System.Single t

Returns
System.Single

InfiniteLineIntersect(Vector2, Vector2, Vector2, Vector2)
public static Vector2 InfiniteLineIntersect(Vector2 ps1, Vector2 pe1, Vector2 ps2, Vector2 pe2)
Parameters
UnityEngine.Vector2 ps1

UnityEngine.Vector2 pe1

UnityEngine.Vector2 ps2

UnityEngine.Vector2 pe2

Returns
UnityEngine.Vector2

InterpolatePoints(Vector3[], Single)
public static Vector3 InterpolatePoints(Vector3[] path, float t)
Parameters
UnityEngine.Vector3[] path

System.Single t

Returns
UnityEngine.Vector3

LerpUnclamped(Vector2, Vector2, Single)
public static Vector2 LerpUnclamped(Vector2 from, Vector2 to, float amount)
Parameters
UnityEngine.Vector2 from

UnityEngine.Vector2 to

System.Single amount

Returns
UnityEngine.Vector2

LerpUnclamped(Vector3, Vector3, Single)
public static Vector3 LerpUnclamped(Vector3 from, Vector3 to, float amount)
Parameters
UnityEngine.Vector3 from

UnityEngine.Vector3 to

System.Single amount

Returns
UnityEngine.Vector3

LinearStep(Single, Single, Single)
public static float LinearStep(float a, float b, float t)
Parameters
System.Single a

System.Single b

System.Single t

Returns
System.Single

LineDistToPlane(Vector3, Vector3, Vector3, Vector3)
public static float LineDistToPlane(Vector3 planeOrigin, Vector3 planeNormal, Vector3 lineOrigin, Vector3 lineDirectionNormalized)
Parameters
UnityEngine.Vector3 planeOrigin

UnityEngine.Vector3 planeNormal

UnityEngine.Vector3 lineOrigin

UnityEngine.Vector3 lineDirectionNormalized

Returns
System.Single

LineIntersectsLine(Vector2, Vector2, Vector2, Vector2, out Vector2)
public static bool LineIntersectsLine(Vector2 a1, Vector2 a2, Vector2 b1, Vector2 b2, out Vector2 intersection)
Parameters
UnityEngine.Vector2 a1

UnityEngine.Vector2 a2

UnityEngine.Vector2 b1

UnityEngine.Vector2 b2

UnityEngine.Vector2 intersection

Returns
System.Boolean

PointDistanceToLine(Vector3, Vector3, Vector3)
public static float PointDistanceToLine(Vector3 point, Vector3 a, Vector3 b)
Parameters
UnityEngine.Vector3 point

UnityEngine.Vector3 a

UnityEngine.Vector3 b

Returns
System.Single

Pow(Vector3, Single)
public static Vector3 Pow(this Vector3 v, float p)
Parameters
UnityEngine.Vector3 v

System.Single p

Returns
UnityEngine.Vector3

RayDistToPlane(Ray, Plane)
public static float RayDistToPlane(Ray ray, Plane plane)
Parameters
UnityEngine.Ray ray

UnityEngine.Plane plane

Returns
System.Single

RotatePoint(Vector2, Single)
public static Vector2 RotatePoint(Vector2 point, float degrees)
Parameters
UnityEngine.Vector2 point

System.Single degrees

Returns
UnityEngine.Vector2

RotatePoint(Vector2, Vector2, Single)
public static Vector2 RotatePoint(Vector2 point, Vector2 around, float degrees)
Parameters
UnityEngine.Vector2 point

UnityEngine.Vector2 around

System.Single degrees

Returns
UnityEngine.Vector2

RoundBasedOnMinimumDifference(Double, Double)
public static double RoundBasedOnMinimumDifference(double valueToRound, double minDifference)
Parameters
System.Double valueToRound

System.Double minDifference

Returns
System.Double

Sign(Vector3)
public static Vector3 Sign(this Vector3 v)
Parameters
UnityEngine.Vector3 v

Returns
UnityEngine.Vector3

SmoothStep(Single, Single, Single)
public static float SmoothStep(float a, float b, float t)
Parameters
System.Single a

System.Single b

System.Single t

Returns
System.Single

StackHermite(Single, Single, Single, Int32)
public static float StackHermite(float start, float end, float t, int count)
Parameters
System.Single start

System.Single end

System.Single t

System.Int32 count

Returns
System.Single

StackHermite01(Single, Int32)
public static float StackHermite01(float t, int count)
Parameters
System.Single t

System.Int32 count

Returns
System.Single

Wrap(Double, Double, Double)
public static double Wrap(double value, double min, double max)
Parameters
System.Double value

System.Double min

System.Double max

Returns
System.Double

Wrap(Int32, Int32, Int32)
public static int Wrap(int value, int min, int max)
Parameters
System.Int32 value

System.Int32 min

System.Int32 max

Returns
System.Int32

Wrap(Single, Single, Single)
public static float Wrap(float value, float min, float max)
Parameters
System.Single value

System.Single min

System.Single max

Returns
System.Single