MathfのDeg2Radを使って角度の変換
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DegRadCheck : MonoBehaviour { | |
void Start(){ | |
Deg2RadCheck(); | |
} | |
void Deg2RadCheck(){ | |
// 度数法で表した角度を弧度法に変換 | |
float degAngle45 = 45f; | |
float degAngle90 = 90f; | |
float degAngle180 = 180f; | |
float degAngle360 = 360f; | |
float radAngle45 = degAngle45 * Mathf.Deg2Rad; | |
float radAngle90 = degAngle90 * Mathf.Deg2Rad; | |
float radAngle180 = degAngle180 * Mathf.Deg2Rad; | |
float radAngle360 = degAngle360 * Mathf.Deg2Rad; | |
Debug.Log(degAngle45 + "度を変換すると " + radAngle45 + " rad。"); | |
Debug.Log(degAngle90 + "度を変換すると " + radAngle90 + " rad。"); | |
Debug.Log(degAngle180 + "度を変換すると " + radAngle180 + " rad。"); | |
Debug.Log(degAngle360 + "度を変換すると " + radAngle360 + " rad。"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment