- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to convert Trigonometric Angles in Radians using C#?
To convert trigonometric angles in Radians, multiply by Math.PI/180. This will convert degrees to radians.
The following is the code −
Example
using System; class Program { static void Main() { Console.WriteLine(Math.Cos(45)); double res = Math.Cos(Math.PI * 45 / 180.0); Console.WriteLine(res); } }
Above, we converted using the following formulae −
Math.PI * angle / 180.0
Advertisements