# 数学函数（[name]）

## 函数（Functions）

### [method:Float clamp]( [param:Float value], [param:Float min], [param:Float max] )

[page:Float value] — 需要clamp处理的值。
[page:Float min] — 最小值。
[page:Float max] — 最大值。

### [method:Integer euclideanModulo]( [param:Integer n], [param:Integer m] )

[page:Integer n], [page:Integer m] - 整型

### [method:Float lerp]( [param:Float x], [param:Float y], [param:Float t] )

[page:Float x] - 起始点。
[page:Float y] - 终点。
[page:Float t] - 闭区间 [0,1] 内的插值因子。

### [method:Float mapLinear]( [param:Float x], [param:Float a1], [param:Float a2], [param:Float b1], [param:Float b2] )

[page:Float x] — 用于映射的值。
[page:Float a1] — A区间最小值。
[page:Float a2] — A区间最大值。
[page:Float b1] — B区间最小值。
[page:Float b2] — A区间最大值。

x从范围[[page:Float a1], [page:Float a2]] 到范围[[page:Float b1], [page:Float b2]]的线性映射。

### [method:Float smoothstep]( [param:Float x], [param:Float min], [param:Float max] )

[page:Float x] - 根据其在最小值和最大值之间的位置来计算的值。
[page:Float min] - 任何x比最小值还小会返回0.
[page:Float max] - 任何x比最大值还大会返回0.

### [method:Float smootherstep]( [param:Float x], [param:Float min], [param:Float max] )

[page:Float x] - 根据其在最小值和最大值之间的位置来计算的值。
[page:Float min] - 任何x比最小值还小会返回0.
[page:Float max] - 任何x比最大值还大会返回0.

### [method:null setQuaternionFromProperEuler]( [param:Quaternion q], [param:Float a], [param:Float b], [param:Float c], [param:String order] )

[page:Quaternion q] - the quaternion to be set
[page:Float a] - the rotation applied to the first axis, in radians
[page:Float b] - the rotation applied to the second axis, in radians
[page:Float c] - the rotation applied to the third axis, in radians
[page:String order] - a string specifying the axes order: 'XYX', 'XZX', 'YXY', 'YZY', 'ZXZ', or 'ZYZ'

Sets quaternion [page:Quaternion q] from the [link:http://en.wikipedia.org/wiki/Euler_angles intrinsic Proper Euler Angles] defined by angles [page:Float a], [page:Float b], and [page:Float c], and order [page:String order].
Rotations are applied to the axes in the order specified by [page:String order]: rotation by angle [page:Float a] is applied first, then by angle [page:Float b], then by angle [page:Float c]. Angles are in radians.