Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Cos Method

Math.Cos Method

Returns the cosine of the specified angle.

Namespace:  System
Assemblies:   mscorlib (in mscorlib.dll)
  System.Runtime.Extensions (in System.Runtime.Extensions.dll)

static member Cos : 
        d:float -> float

Parameters

d
Type: System.Double

An angle, measured in radians.

Return Value

Type: System.Double
The cosine of d. If d is equal to NaN, NegativeInfinity, or PositiveInfinity, this method returns NaN.

The angle, d, must be in radians. Multiply by Math.PI/180 to convert degrees to radians.

Acceptable values of d range from approximately -9223372036854775295 to approximately 9223372036854775295. For values outside this range, the Cos method returns d unchanged rather than throwing an exception.

The following example uses Cos to evaluate certain trigonometric identities for selected angles.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

XNA Framework

Supported in: 3.0, 2.0, 1.0

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8

Portable Class Library

Supported in: Portable Class Library
Show:
© 2015 Microsoft