Interface IMath
Namespace: GameCanvas
Assembly: GameCanvas.dll
Syntax
public interface IMath
Methods
Abs(Int32)
絶対値を計算します
Declaration
int Abs(in int value)
Parameters
Type | Name | Description |
---|---|---|
Int32 | value | 入力値 |
Returns
Type | Description |
---|---|
Int32 | 絶対値 |
Abs(Single)
絶対値を計算します
Declaration
float Abs(in float value)
Parameters
Type | Name | Description |
---|---|---|
Single | value | 入力値 |
Returns
Type | Description |
---|---|
Single | 絶対値 |
AlmostSame(Single, Single)
計算誤差を考慮して同値かどうか判定します
Declaration
bool AlmostSame(in float a, in float b)
Parameters
Type | Name | Description |
---|---|---|
Single | a | |
Single | b |
Returns
Type | Description |
---|---|
Boolean | 同値かどうか |
AlmostZero(Single)
計算誤差を考慮してゼロかどうか判定します
Declaration
bool AlmostZero(in float value)
Parameters
Type | Name | Description |
---|---|---|
Single | value | 入力値 |
Returns
Type | Description |
---|---|
Boolean | ゼロかどうか |
Atan2(float2)
ベクトルとX+軸平面のなす角度を計算します
Declaration
float Atan2(in float2 v)
Parameters
Type | Name | Description |
---|---|---|
float2 | v | ベクトル |
Returns
Type | Description |
---|---|
Single | 角度(度数法) |
Clamp(Single, Single, Single)
値を丸めます
Declaration
float Clamp(in float value, in float min, in float max)
Parameters
Type | Name | Description |
---|---|---|
Single | value | 入力値 |
Single | min | 最小値 |
Single | max | 最大値 |
Returns
Type | Description |
---|---|
Single |
Cos(Single)
コサインを計算します
Declaration
float Cos(in float degree)
Parameters
Type | Name | Description |
---|---|---|
Single | degree | 角度(度数法) |
Returns
Type | Description |
---|---|
Single | コサイン |
Cross(float2, float2)
ベクトルの外積を計算します
Declaration
float Cross(in float2 a, in float2 b)
Parameters
Type | Name | Description |
---|---|---|
float2 | a | |
float2 | b |
Returns
Type | Description |
---|---|
Single | 外積 |
Dot(float2, float2)
ベクトルの内積を計算します
Declaration
float Dot(in float2 a, in float2 b)
Parameters
Type | Name | Description |
---|---|---|
float2 | a | |
float2 | b |
Returns
Type | Description |
---|---|
Single | 内積 |
Max(Single, Single)
2つの値を比較して、より大きい方を返します
Declaration
float Max(in float a, in float b)
Parameters
Type | Name | Description |
---|---|---|
Single | a | |
Single | b |
Returns
Type | Description |
---|---|
Single | 大きい方の値 |
Min(Single, Single)
2つの値を比較して、より小さい方を返します
Declaration
float Min(in float a, in float b)
Parameters
Type | Name | Description |
---|---|---|
Single | a | |
Single | b |
Returns
Type | Description |
---|---|
Single | 小さい方の値 |
Random()
0以上1未満のランダムな値を算出します
Declaration
float Random()
Returns
Type | Description |
---|---|
Single | ランダムな値 |
Random(Int32, Int32)
min
以上max
以下のランダムな値を算出します
Declaration
int Random(in int min, in int max)
Parameters
Type | Name | Description |
---|---|---|
Int32 | min | 最小値 |
Int32 | max | 最大値 |
Returns
Type | Description |
---|---|
Int32 | ランダムな値 |
Random(Single, Single)
min
以上max
未満のランダムな値を算出します
Declaration
float Random(in float min, in float max)
Parameters
Type | Name | Description |
---|---|---|
Single | min | 最小値 |
Single | max | 最大値 |
Returns
Type | Description |
---|---|
Single | ランダムな値 |
Repeat(Single, Single)
値を 0 から max
までの範囲を繰り返すよう値を丸めます
Declaration
float Repeat(in float value, in float max)
Parameters
Type | Name | Description |
---|---|---|
Single | value | 入力値 |
Single | max | 最大値 |
Returns
Type | Description |
---|---|
Single |
RotateVector(float2, Single)
ベクトルを回転します
Declaration
float2 RotateVector(in float2 vector, in float degree)
Parameters
Type | Name | Description |
---|---|---|
float2 | vector | ベクトル |
Single | degree | 回転量(度数法) |
Returns
Type | Description |
---|---|
float2 | 回転後のベクトル |
Round(Double)
値を四捨五入します
Declaration
int Round(in double value)
Parameters
Type | Name | Description |
---|---|---|
Double | value | 入力値 |
Returns
Type | Description |
---|---|
Int32 | 四捨五入された値 |
Round(Single)
値を四捨五入します
Declaration
int Round(in float value)
Parameters
Type | Name | Description |
---|---|---|
Single | value | 入力値 |
Returns
Type | Description |
---|---|
Int32 | 四捨五入された値 |
SetRandomSeed(UInt32)
ランダム計算のシード値を設定します
Declaration
void SetRandomSeed(in uint seed)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | seed | シード値 |
Sin(Single)
サインを計算します
Declaration
float Sin(in float degree)
Parameters
Type | Name | Description |
---|---|---|
Single | degree | 角度(度数法) |
Returns
Type | Description |
---|---|
Single | サイン |
Sqrt(Single)
平方根を計算します
Declaration
float Sqrt(in float value)
Parameters
Type | Name | Description |
---|---|---|
Single | value | 入力値 |
Returns
Type | Description |
---|---|
Single | 平方根 |