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.");
}
Page last updated: 2011-2-21