Namespace: math

math

Members Show Inherited

staticmath.DEG2RADNumber

角度值转弧度值

staticmath.RAD2DEGNumber

弧度值转角度值

Methods Show Inherited

staticmath.generateUUID(prefix){String}

生成唯一ID

Name Type Default Description
prefix String '' optional

ID前缀

Returns:
Type Description
String ID

staticmath.clamp(value, min, max){Number}

截取

Name Type Description
value Number

min Number

最小值

max Number

最大值

Returns:
Type Description
Number

staticmath.degToRad(deg){Number}

角度值转换成弧度值

Name Type Description
deg Number

角度值

Returns:
Type Description
Number 弧度值

staticmath.radToDeg(rad){Number}

弧度值转换成角度值

Name Type Description
rad Number

弧度值

Returns:
Type Description
Number 角度值

staticmath.isPowerOfTwo(value){Boolean}

是否是 2 的指数值

Name Type Description
value Number
Returns:
Type Description
Boolean

staticmath.nearestPowerOfTwo(value){Uint}

最近的 2 的指数值

Name Type Description
value Uint
Returns:
Type Description
Uint

staticmath.nextPowerOfTwo(value){Uint}

下一个的 2 的指数值

Name Type Description
value Uint
Returns:
Type Description
Uint