Mathf
- Abs
- Acos
- Approximately
- Asin
- Atan2
- Atan
- CeilToInt
- Ceil
- Clamp01
- Clamp
- ClosestPowerOfTwo
- Cos
- Deg2Rad
- DeltaAngle
- Epsilon
- Exp
- FloorToInt
- Floor
- Infinity
- InverseLerp
- IsPowerOfTwo
- LerpAngle
- Lerp
- Log10
- Log
- Max
- Min
- MoveTowardsAngle
- MoveTowards
- NegativeInfinity
- NextPowerOfTwo
- PingPong
- PI
- Pow
- Rad2Deg
- Repeat
- RoundToInt
- Round
- Sign
- Sin
- SmoothDampAngle
- SmoothDamp
- SmoothStep
- Sqrt
- Tan
Mathf.Log 对数
static function Log (f : float, p : float) : float
Description描述
Returns the logarithm of a specified number in a specified base.
返回参数 f 的对数。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public void Awake() {
print(Mathf.Log(6, 2));
}
}
// logarithm of 6 in base 2
//以2为底6的对数
// prints 2.584963
print(Mathf.Log(6, 2));
•static function Log (f : float) : float
Description描述
Returns the natural (base e) logarithm of a specified number.
返回参数 f 的自然对数(基数e)。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public void Awake() {
print(Mathf.Log(10));
}
}
// natural logarithm of 10
//10的自然对数
// prints 4.60517
print(Mathf.Log(10));
最后修改:2011年2月22日 Tuesday 19:41