移除Core,新增各接口用于sdk扩展

This commit is contained in:
yhh
2020-12-30 16:28:07 +08:00
parent f934890fac
commit d84ffcc2b7
28 changed files with 2008 additions and 653 deletions

View File

@@ -135,5 +135,27 @@ module es {
return Math.max(start - shift, end);
}
/**
* 计算两个给定角之间的最短差值(度数)
* @param current
* @param target
*/
public static deltaAngle(current: number, target: number) {
let num = this.repeat(target - current, 360);
if (num > 180)
num -= 360;
return num;
}
/**
* 循环t使其永远不大于长度永远不小于0
* @param t
* @param length
*/
public static repeat(t: number, length: number) {
return t - Math.floor(t / length) * length;
}
}
}