MathUtils
Inheritance: java.lang.Object
public class MathUtils
Kullanışlı matematiksel yardımcı programların bir seti.
Yöntemler
calcNormal(Vector3[] points)
public static Vector3 calcNormal(Vector3[] points)
Parameters:
| Parametre | Tür | Açıklama |
|---|---|---|
| points | Vector3[] |
Returns: Vector3
clamp(double val, double min, double max)
public static double clamp(double val, double min, double max)
Değeri [min, max] aralığına sınırlayın
Parameters:
| Parametre | Tür | Açıklama |
|---|---|---|
| val | double | Sınırlanacak değer. |
| min | double | Minimum değer. |
| max | double | Maximum değer. |
Returns: double - [min, max] arasındaki değer Example:
double val = 195;
//Clamp value to [0, 100]
double clampedValue = MathUtils.clamp(val, 0, 100);
//This will output 100
System.out.printf("Value = %d", val);
equals(Object arg0)
public boolean equals(Object arg0)
Parameters:
| Parametre | Tür | Açıklama |
|---|---|---|
| arg0 | java.lang.Object |
Returns: boolean
findIntersection(Vector2 p0, Vector2 d0, Vector2 p1, Vector2 d1, Vector2[] results)
public static int findIntersection(Vector2 p0, Vector2 d0, Vector2 p1, Vector2 d1, Vector2[] results)
Parameters:
| Parametre | Tür | Açıklama |
|---|---|---|
| p0 | Vector2 | |
| d0 | Vector2 | |
| p1 | Vector2 | |
| d1 | Vector2 | |
| results | Vector2[] |
Returns: int
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class
hashCode()
public native int hashCode()
Returns: int
notify()
public final native void notify()
notifyAll()
public final native void notifyAll()
pointInsideTriangle(Vector2 p, Vector2 p0, Vector2 p1, Vector2 p2)
public static boolean pointInsideTriangle(Vector2 p, Vector2 p0, Vector2 p1, Vector2 p2)
p noktasının (p0, p1, p2) üçgeninin içinde olup olmadığını kontrol et
Parameters:
| Parametre | Tür | Açıklama |
|---|---|---|
| p | Vector2 | |
| p0 | Vector2 | |
| p1 | Vector2 | |
| p2 | Vector2 |
Returns: boolean
rayIntersect(Vector2 origin, Vector2 dir, Vector2 a, Vector2 b)
public static Vector2 rayIntersect(Vector2 origin, Vector2 dir, Vector2 a, Vector2 b)
Işının (origin, dir) çizgi segmenti (start, end) ile kesişip kesişmediğini kontrol et
Parameters:
| Parametre | Tür | Açıklama |
|---|---|---|
| origin | Vector2 | |
| dir | Vector2 | |
| a | Vector2 | |
| b | Vector2 |
Returns: Vector2
toDegree(Vector3 radian)
public static Vector3 toDegree(Vector3 radian)
Vector3 nesnesini radyandan dereceye dönüştür.
Parameters:
| Parametre | Tür | Açıklama |
|---|---|---|
| radian | Vector3 | Radyan değeri. |
Returns: Vector3 - The degree value. Example:
Vector3 degrees = MathUtils.toDegree(new Vector3(0.34, 0.9, 0.2));
System.out.printf("Degrees = %s", degrees);
toDegree(double radian)
public static double toDegree(double radian)
Bir sayıyı radyandan dereceye dönüştür
Parameters:
| Parametre | Tür | Açıklama |
|---|---|---|
| radyan | double | Radyan değeri. |
Returns: double - Derece değeri. Example:
var deg = MathUtils.toDegree(0.3);
System.out.printf("Degrees = %s", deg);
toDegree(double x, double y, double z)
public static Vector3 toDegree(double x, double y, double z)
Bir sayıyı radyandan dereceye dönüştür
Parameters:
| Parametre | Tür | Açıklama |
|---|---|---|
| x | double | Radyan değerindeki x bileşeni. |
| y | double | Radyan değerindeki y bileşeni. |
| z | double | Radyan değerindeki z bileşeni. |
Returns: Vector3 - The degree value.
toDegree(float radian)
public static float toDegree(float radian)
Bir sayıyı radyandan dereceye dönüştür
Parameters:
| Parametre | Tür | Açıklama |
|---|---|---|
| radyan | float | Radyan değeri. |
Returns: float - Derece değeri. Example:
var deg = MathUtils.toDegree(0.3f);
System.out.printf("Degrees = %s", deg);
toRadian(Vector3 degree)
public static Vector3 toRadian(Vector3 degree)
Vector3 nesnesini dereceden radyana dönüştür
Parameters:
| Parametre | Tür | Açıklama |
|---|---|---|
| degree | Vector3 | Derece değeri. |
Returns: Vector3 - The radian value. Example:
Vector3 radians = MathUtils.toRadian(new Vector3(90, 134, 0));
System.out.printf("Radians = %s", radians);
toRadian(double degree)
public static double toRadian(double degree)
Bir sayıyı dereceden radyana dönüştür
Parameters:
| Parametre | Tür | Açıklama |
|---|---|---|
| derece | double | Derece değeri. |
Returns: double - Radyan değeri. Example:
var rad = MathUtils.toRadian(0.3);
System.out.printf("Radian = %d", rad);
toRadian(double x, double y, double z)
public static Vector3 toRadian(double x, double y, double z)
Bir vektörü dereceden radyana dönüştür
Parameters:
| Parametre | Tür | Açıklama |
|---|---|---|
| x | double | Derece değerindeki x bileşeni. |
| y | double | Derece değerindeki y bileşeni. |
| z | double | Derece değerindeki z bileşeni. |
Returns: Vector3 - The radian value.
toRadian(float degree)
public static float toRadian(float degree)
Bir sayıyı dereceden radyana dönüştür
Parameters:
| Parametre | Tür | Açıklama |
|---|---|---|
| derece | float | Derece değeri. |
Returns: float - Radyan değeri. Example:
var rad = MathUtils.toRadian(0.3);
System.out.printf("Radian = %d", rad);
toString()
public String toString()
Returns: java.lang.String
wait()
public final void wait()
wait(long arg0)
public final void wait(long arg0)
Parameters:
| Parametre | Tür | Açıklama |
|---|---|---|
| arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
| Parametre | Tür | Açıklama |
|---|---|---|
| arg0 | long | |
| arg1 | int |