- Trending Categories
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
Trigonometric Functions in C#
Trignometric Functions in C# include, ACos, ASin, Sin, Cos, Tan, etc. It comes under the Math type of the System namespace.
The following is an example showing how to implement trigonometric functions in C# −
Example
using System; class Program { static void Main() { Console.WriteLine(Math.Acos(0)); Console.WriteLine(Math.Cos(2)); Console.WriteLine(Math.Asin(0.2)); Console.WriteLine(Math.Sin(2)); Console.WriteLine(Math.Atan(-5)); Console.WriteLine(Math.Tan(1)); } }
Output
1.5707963267949 -0.416146836547142 0.201357920790331 0.909297426825682 -1.37340076694502 1.5574077246549
Above we saw the Inverse Sine value using Asin −
Math.Asin(0.2)
With that, we also saw the Inverse Cosine value using Acos −
Math.Acos(0)
In the same way, we found out the value of Tan(1), Atab(-5), Sin(2) and Cos(2).
Advertisements