C# Math Cos
Description
Math Cos
returns the cosine of the specified angle.
Syntax
Math.Cos
has the following syntax.
public static double Cos(
double d
)
Parameters
Math.Cos
has the following parameters.
d
- An angle, measured in radians.
Returns
Math.Cos
method returns The cosine of d. If d is equal to NaN, NegativeInfinity, or PositiveInfinity,
this method returns NaN.
Example
The following code shows how to use Math.Cos method.
using System;/*from w ww . j a va 2s . c o m*/
public class MainClass{
public static void Main(String[] argv){
System.Console.WriteLine(Math.Cos(0.5));
}
}
The code above generates the following result.