Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
MathfのRad2Degを使って角度の変換
void Rad2DegCheck(){
// 弧度法で表した角度を度数法に変換
float radAngle45 = 1.0f / 4.0f * Mathf.PI;
float radAngle90 = 1.0f / 2.0f * Mathf.PI;
float radAngle180 = Mathf.PI;
float radAngle360 = 2.0f * Mathf.PI;
float degAngle45 = radAngle45 * Mathf.Rad2Deg;
float degAngle90 = radAngle90 * Mathf.Rad2Deg;
float degAngle180 = radAngle180 * Mathf.Rad2Deg;
float degAngle360 = radAngle360 * Mathf.Rad2Deg;
Debug.Log(radAngle45 + "radを変換すると " + degAngle45 + " 度。");
Debug.Log(radAngle90 + "radを変換すると " + degAngle90 + " 度。");
Debug.Log(radAngle180 + "radを変換すると " + degAngle180 + " 度。");
Debug.Log(radAngle360 + "radを変換すると " + degAngle360 + " 度。");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.