MathF.Cos(Single) is an inbuilt MathF class method which returns the cosine of a given float value argument(specified angle).
Syntax: public static float Cos (float x);
Here, x is the angle(measured in radian) whose cosine is to be returned and the type of this parameter is System.Single.
Return Value: This method will return the cosine of x of type System.Single. If x is equal to NegativeInfinity, PositiveInfinity, or NaN, then this method returns NaN.
Below are the programs to illustrate the use of the above-discussed method:
0.7071068 0.5877852 0.34202
Example 2: To show the working of MathF.Cos() method when the argument is NaN or Infinity.
NaN NaN NaN
- MathF.Sin() Method in C# with Examples
- MathF.Log() Method in C# with Examples
- MathF.Pow() Method in C# with Examples
- MathF.Exp() Method in C# with Examples
- MathF.Max() Method in C# with Examples
- MathF.Tan() Method in C# with Examples
- MathF.Min() Method in C# with Examples
- MathF.Abs() Method in C# with Examples
- Int64.Equals Method in C# with Examples
- Int32.CompareTo Method in C# with Examples
- Decimal.GetHashCode Method in C# with Examples
- Decimal.GetTypeCode Method in C# with Examples
- C# | Char.GetTypeCode() Method with Examples
- C# | Char.GetHashCode() Method with Examples
- Int32.Equals Method in C# with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.