Math.Cos Function in VB.NET

What is the use of math.cos() mathematical function in VB.NET?

Explanation

Math.Cos Function

Math.Cos() Mathematical Function in VB.net 2008 is used to find the Cosine value for the given angle. If the specified angle is positive or negative infinity or Not a Number, the value returned is 'NaN'.
Syntax:

Math.Cos(Value)

In the above syntax Value specifies the angle to return the cosine value.
Example:

Module Module1
Sub Main()
Dim x As Double = 0
Console.WriteLine("The Cosine value of 0 is::" & Math.Cos(0))
Console.ReadLine()
End Sub
End Module
Result:

The Cosine value of 0 is::1

In the above example, the Math.Cos() mathematical function is used to get the cosine value of '0', which returns '1'.

Visual Basic Tutorial


Ask Questions

Ask Question