インターフェイス IMath
Namespace: GameCanvas
csharp
public interface IMathメソッド
Abs(float)
csharp
float Abs(in float value)絶対値を計算します
パラメーター
value— 入力値
戻り値
絶対値
Abs(int)
csharp
int Abs(in int value)絶対値を計算します
パラメーター
value— 入力値
戻り値
絶対値
AlmostSame(float, float)
csharp
bool AlmostSame(in float a, in float b)計算誤差を考慮して同値かどうか判定します
戻り値
同値かどうか
AlmostZero(float)
csharp
bool AlmostZero(in float value)計算誤差を考慮してゼロかどうか判定します
パラメーター
value— 入力値
戻り値
ゼロかどうか
Atan2(float2)
csharp
float Atan2(in float2 v)ベクトルとX+軸平面のなす角度を計算します
パラメーター
v— ベクトル
戻り値
角度(度数法)
Clamp(float, float, float)
csharp
float Clamp(in float value, in float min, in float max)値を丸めます
パラメーター
value— 入力値min— 最小値max— 最大値
Cos(float)
csharp
float Cos(in float degree)コサインを計算します
パラメーター
degree— 角度(度数法)
戻り値
コサイン
Cross(float2, float2)
csharp
float Cross(in float2 a, in float2 b)ベクトルの外積を計算します
戻り値
外積
Dot(float2, float2)
csharp
float Dot(in float2 a, in float2 b)ベクトルの内積を計算します
戻り値
内積
GetRandomState()
csharp
uint GetRandomState()乱数計算の現在の状態(≒シード値)を取得します
戻り値
シード値
Max(float, float)
csharp
float Max(in float a, in float b)2つの値を比較して、より大きい方を返します
戻り値
大きい方の値
Min(float, float)
csharp
float Min(in float a, in float b)2つの値を比較して、より小さい方を返します
戻り値
小さい方の値
Random()
csharp
float Random()0以上1未満のランダムな値を算出します
戻り値
ランダムな値
Random(float, float)
csharp
float Random(in float min, in float max)min以上max未満のランダムな値を算出します
パラメーター
min— 最小値max— 最大値
戻り値
ランダムな値
Random(int, int)
csharp
int Random(in int min, in int max)min以上max以下のランダムな値を算出します
パラメーター
min— 最小値max— 最大値
戻り値
ランダムな値
Repeat(float, float)
csharp
float Repeat(in float value, in float max)値を 0 から max までの範囲を繰り返すよう値を丸めます
パラメーター
value— 入力値max— 最大値
RotateVector(float2, float)
csharp
float2 RotateVector(in float2 vector, in float degree)ベクトルを回転します
パラメーター
vector— ベクトルdegree— 回転量(度数法)
戻り値
回転後のベクトル
Round(double)
csharp
int Round(in double value)値を四捨五入します
パラメーター
value— 入力値
戻り値
四捨五入された値
Round(float)
csharp
int Round(in float value)値を四捨五入します
パラメーター
value— 入力値
戻り値
四捨五入された値
SetRandomSeed(uint)
csharp
void SetRandomSeed(in uint seed)乱数計算のシード値を設定します
パラメーター
seed— シード値
SetRandomSeedByIndex(uint)
csharp
void SetRandomSeedByIndex(in uint index)乱数計算のシード値をインデックスから設定します
パラメーター
index— インデックス
Sin(float)
csharp
float Sin(in float degree)サインを計算します
パラメーター
degree— 角度(度数法)
戻り値
サイン
Sqrt(float)
csharp
float Sqrt(in float value)平方根を計算します
パラメーター
value— 入力値
戻り値
平方根
