public class MathUtil
extends java.lang.Object
コンストラクタと説明 |
---|
MathUtil() |
修飾子とタイプ | メソッドと説明 |
---|---|
static double |
blendValue(double a,
double b,
double blend)
係数ブレンドを行い、結果を返す。
|
static float |
blendValue(float a,
float b,
float blend)
係数ブレンドを行い、結果を返す。
|
static double |
calcNearDegree(double now,
double target)
targetの角度を向かせるためにちょうどいい角度を算出する。
|
static boolean |
isFlagOn(int flg,
int check)
特定のビットフラグが立っていることを検証する。
|
static boolean |
isFlagOnAll(int flg,
int check)
特定のビットフラグがすべて立っていることを検証する。
|
static double |
minmax(double min,
double max,
double now) |
static float |
minmax(float min,
float max,
float now)
min <= result <= maxとなるようにnowを補正する。
|
static int |
minmax(int min,
int max,
int now)
min <= result <= maxとなるようにnowを補正する。
|
static double |
normalizeDegree(double now)
360度系の正規化を行う。
|
static float |
normalizeDegree(float now)
360度系の正規化を行う。
|
static int |
setFlag(int flg,
int check,
boolean is)
フラグ情報を設定する。
|
static double |
targetMove(double now,
double offset,
double target)
目標数値へ移動する。
|
static float |
targetMove(float now,
float offset,
float target)
目標数値へ移動する。
|
static int |
targetMove(int now,
int offset,
int target)
目標数値へ移動する。
|
static double |
valueOf(java.lang.String format,
java.lang.String value)
特定のフォーマットに合う数値に変換する
%.1f, 0.111111 ->0.1 |
public static final int setFlag(int flg, int check, boolean is)
flg
- check
- is
- ビットを立てる場合はtrue、下げる場合はfalsepublic static final int minmax(int min, int max, int now)
min
- max
- now
- public static final float minmax(float min, float max, float now)
min
- max
- now
- public static final double minmax(double min, double max, double now)
public static final float normalizeDegree(float now)
now
- 現在の360度系角度public static final double normalizeDegree(double now)
now
- 現在の360度系角度public static final double calcNearDegree(double now, double target)
now
- target
- public static final double targetMove(double now, double offset, double target)
now
- 現在値offset
- 移動量target
- 目標とすべき値public static final float targetMove(float now, float offset, float target)
now
- 現在値offset
- 移動量target
- 目標とすべき値public static final int targetMove(int now, int offset, int target)
now
- 現在値offset
- 移動量target
- 目標とすべき値public static float blendValue(float a, float b, float blend)
a
- 遷移後の値b
- 遷移前の値blend
- aのブレンド値public static double blendValue(double a, double b, double blend)
a
- 遷移後の値b
- 遷移前の値blend
- aのブレンド値public static final boolean isFlagOn(int flg, int check)
flg
- check
- public static final boolean isFlagOnAll(int flg, int check)
flg
- check
- public static final double valueOf(java.lang.String format, java.lang.String value)
format
- value
-