Math.Acos Function in VB.NET

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

Explanation

Math.Acos Function

Math.Acos Mathematical Function in Visual Basic.net 2008 is used to find the Arc Cosine value for the given Cosine value.
Syntax:

Math.Acos(Value)

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

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

The Arc Cosine value of 0 is::1.5707963267949
The Arc Cosine value of 1 is::0
The Arc Cosine value of -2 is::NaN

In the above example, the Math.Acos() mathematical function is used to get the arc cosine value of '0','1'. Since '-2' exceeds the range of '-1' to '1', it returns 'NaN'.

Visual Basic Tutorial


Ask Questions

Ask Question