Convert degrees to radians. - CSharp System

CSharp examples for System:Math Number

Description

Convert degrees to radians.

Demo Code

// Licensed under the Apache License, Version 2.0 (the "License");
using System;//  w w  w .  java  2 s  . c  om

public class Main{
        /// <summary>
        /// Convert degrees to radians.
        /// </summary>
        /// <param name="deg">Degrees</param>
        /// <returns>Radians</returns>
        public static double Deg2Rad(double deg)
        {
            return deg*(Math.PI/180.0);
        }
}

Related Tutorials