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.Deg2Rad 度转弧度
static var Deg2Rad : float
Description描述
Degrees-to-radians conversion constant (Read Only).
度到弧度的转化常量。(只读)[di'gri:s] ['reidiəns]
This is equal to (PI * 2) / 360.
这等于(PI * 2) / 360。
参考: Rad2Deg 常数
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public float deg = 30.0F;
void Start() {
float rad = deg * Mathf.Deg2Rad;
Debug.Log(deg + "degrees are equal to " + rad + " radians.");
}
}
// convert 30 degrees to radians
//转换30度到弧度
var deg : float = 30.0;
function Start() {
var rad : float = deg * Mathf.Deg2Rad;
Debug.Log(deg + "degrees are equal to " + rad + " radians.");
}
最后修改:2011年2月21日 Monday 11:37