Class MathUtil
Inheritance
System.Object
MathUtil
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: cs.temp.dll.dll
Syntax
public static class MathUtil
Methods
Clamp(Vector2, Vector2, Vector2)
new Vector2(Mathf.Clamp(v.x, min.x, max.x), Mathf.Clamp(v.y, min.y, max.y))
Declaration
public static Vector2 Clamp(Vector2 v, Vector2 min, Vector2 max)
Parameters
Type |
Name |
Description |
Vector2 |
v |
|
Vector2 |
min |
|
Vector2 |
max |
|
Returns
Clamp(Vector3, Vector3, Vector3)
new Vector3(Mathf.Clamp(v.x, min.x, max.x), Mathf.Clamp(v.y, min.y, max.y), Mathf.Clamp(v.z, min.z, max.z))
Declaration
public static Vector3 Clamp(Vector3 v, Vector3 min, Vector3 max)
Parameters
Type |
Name |
Description |
Vector3 |
v |
|
Vector3 |
min |
|
Vector3 |
max |
|
Returns
GetDigit(Int32)
Declaration
public static int GetDigit(int num)
Parameters
Type |
Name |
Description |
System.Int32 |
num |
|
Returns
Type |
Description |
System.Int32 |
|
GetDigit(Int64)
Declaration
public static int GetDigit(long num)
Parameters
Type |
Name |
Description |
System.Int64 |
num |
|
Returns
Type |
Description |
System.Int32 |
|
Lerp(Double, Double, Single)
Declaration
public static double Lerp(double a, double b, float t)
Parameters
Type |
Name |
Description |
System.Double |
a |
|
System.Double |
b |
|
System.Single |
t |
|
Returns
Type |
Description |
System.Double |
|
Lerp(Single, Single, Single, Single)
Declaration
public static float Lerp(float a, float b, float t, float n)
Parameters
Type |
Name |
Description |
System.Single |
a |
|
System.Single |
b |
|
System.Single |
t |
|
System.Single |
n |
|
Returns
Type |
Description |
System.Single |
|
Lerp(Vector2, Vector2, Single)
Declaration
public static Vector2 Lerp(Vector2 a, Vector2 b, float t)
Parameters
Type |
Name |
Description |
Vector2 |
a |
|
Vector2 |
b |
|
System.Single |
t |
|
Returns
Lerp(Vector2, Vector2, Single, Single)
Declaration
public static Vector2 Lerp(Vector2 a, Vector2 b, float xt, float yt)
Parameters
Type |
Name |
Description |
Vector2 |
a |
|
Vector2 |
b |
|
System.Single |
xt |
|
System.Single |
yt |
|
Returns
Lerp(Vector2, Vector2, Vector2)
Declaration
public static Vector2 Lerp(Vector2 a, Vector2 b, Vector2 t)
Parameters
Type |
Name |
Description |
Vector2 |
a |
|
Vector2 |
b |
|
Vector2 |
t |
|
Returns
Max(Int32, Int32, Int32)
3引数のMathf.Max(可変長引数だとGCが発生するのでオーバーロードで定義)
Declaration
public static int Max(int a, int b, int c)
Parameters
Type |
Name |
Description |
System.Int32 |
a |
|
System.Int32 |
b |
|
System.Int32 |
c |
|
Returns
Type |
Description |
System.Int32 |
|
Max(Int32, Int32, Int32, Int32)
4引数のMathf.Max(可変長引数だとGCが発生するのでオーバーロードで定義)
Declaration
public static int Max(int a, int b, int c, int d)
Parameters
Type |
Name |
Description |
System.Int32 |
a |
|
System.Int32 |
b |
|
System.Int32 |
c |
|
System.Int32 |
d |
|
Returns
Type |
Description |
System.Int32 |
|
Max(Vector2, Vector2)
Declaration
public static Vector2 Max(Vector2 a, Vector2 b)
Parameters
Type |
Name |
Description |
Vector2 |
a |
|
Vector2 |
b |
|
Returns
Min(Int32, Int32, Int32)
3引数のMathf.Min(可変長引数だとGCが発生するのでオーバーロードで定義)
Declaration
public static int Min(int a, int b, int c)
Parameters
Type |
Name |
Description |
System.Int32 |
a |
|
System.Int32 |
b |
|
System.Int32 |
c |
|
Returns
Type |
Description |
System.Int32 |
|
Min(Int32, Int32, Int32, Int32)
4引数のMathf.Min(可変長引数だとGCが発生するのでオーバーロードで定義)
Declaration
public static int Min(int a, int b, int c, int d)
Parameters
Type |
Name |
Description |
System.Int32 |
a |
|
System.Int32 |
b |
|
System.Int32 |
c |
|
System.Int32 |
d |
|
Returns
Type |
Description |
System.Int32 |
|
Min(Vector2, Vector2)
Declaration
public static Vector2 Min(Vector2 a, Vector2 b)
Parameters
Type |
Name |
Description |
Vector2 |
a |
|
Vector2 |
b |
|
Returns
NormalizedClamp(Single, Single, Single)
正規化した(a - min) / (max - min) を0~1でClampした結果を返す
Declaration
public static float NormalizedClamp(float a, float min, float max)
Parameters
Type |
Name |
Description |
System.Single |
a |
|
System.Single |
min |
|
System.Single |
max |
|
Returns
Type |
Description |
System.Single |
|
Quad(Single, Single, Single, Single)
f(0) = y0, f(0.5) = y1, f(1) = y2 を通る2次曲線. y(t) = a t^2 + b t^2 + cの値を返す
Declaration
public static float Quad(float y0, float y1, float y2, float t)
Parameters
Type |
Name |
Description |
System.Single |
y0 |
|
System.Single |
y1 |
|
System.Single |
y2 |
|
System.Single |
t |
|
Returns
Type |
Description |
System.Single |
|
Quad(Single, Single, Single, out Single, out Single, out Single)
f(0) = y0, f(0.5) = y1, f(1) = y2 を通る2次曲線. y(t) = a t^2 + b t^2 + c のa,b,cを返す
Declaration
public static void Quad(float y0, float y1, float y2, out float a, out float b, out float c)
Parameters
Type |
Name |
Description |
System.Single |
y0 |
|
System.Single |
y1 |
|
System.Single |
y2 |
|
System.Single |
a |
|
System.Single |
b |
|
System.Single |
c |
|
Quad(Vector2, Vector2, Vector2, Single)
f(0) = yv0, f(0.5) = v1, f(1) = v2 を通る2次曲線. y(t) = a t^2 + b t^2 + cの値を返す
Declaration
public static Vector2 Quad(Vector2 y0, Vector2 y1, Vector2 y2, float t)
Parameters
Type |
Name |
Description |
Vector2 |
y0 |
|
Vector2 |
y1 |
|
Vector2 |
y2 |
|
System.Single |
t |
|
Returns
Quad(Vector2, Vector2, Vector2, out Vector2, out Vector2, out Vector2)
f(0) = y0, f(0.5) = y1, f(1) = y2 を通る2次曲線. y(t) = a t^2 + b t^2 + c のa,b,cを返す
Declaration
public static void Quad(Vector2 y0, Vector2 y1, Vector2 y2, out Vector2 a, out Vector2 b, out Vector2 c)
Parameters
Type |
Name |
Description |
Vector2 |
y0 |
|
Vector2 |
y1 |
|
Vector2 |
y2 |
|
Vector2 |
a |
|
Vector2 |
b |
|
Vector2 |
c |
|
Quad(Vector3, Vector3, Vector3, out Vector3, out Vector3, out Vector3)
f(0) = y0, f(0.5) = y1, f(1) = y2 を通る2次曲線. y(t) = a t^2 + b t^2 + c のa,b,cを返す
Declaration
public static void Quad(Vector3 y0, Vector3 y1, Vector3 y2, out Vector3 a, out Vector3 b, out Vector3 c)
Parameters
Type |
Name |
Description |
Vector3 |
y0 |
|
Vector3 |
y1 |
|
Vector3 |
y2 |
|
Vector3 |
a |
|
Vector3 |
b |
|
Vector3 |
c |
|