绘制帮助类

This commit is contained in:
yhh
2020-07-09 16:16:04 +08:00
parent 817b703d4f
commit a80bb4b6f3
13 changed files with 484 additions and 2 deletions

View File

@@ -50,7 +50,15 @@ class MathHelper {
return new Vector2(Math.cos(radians) * radians + circleCenter.x, Math.sin(radians) * radians + circleCenter.y);
}
/**
* 如果值为偶数返回true
* @param value
*/
public static isEven(value: number){
return value % 2 == 0;
}
public static angleBetweenVectors(from: Vector2, to: Vector2){
return Math.atan2(to.y - from.y, to.x - from.x);
}
}