หากต้องการแปลงมุมตรีโกณมิติเป็นเรเดียน ให้คูณด้วย Math.PI/180 ซึ่งจะแปลงองศาเป็นเรเดียน
ต่อไปนี้เป็นรหัส −
ตัวอย่าง
using System;
class Program {
static void Main() {
Console.WriteLine(Math.Cos(45));
double res = Math.Cos(Math.PI * 45 / 180.0);
Console.WriteLine(res);
}
} ด้านบน เราแปลงโดยใช้สูตรต่อไปนี้ -
Math.PI * angle / 180.0