Home >>VB.Net Programs >VB.Net program to find the angle for specified cosine value

VB.Net program to find the angle for specified cosine value

Write a VB.Net program to find the angle for specified cosine value

The angle for the specified cosine value will be listed here and the angle values for various cosine values will be print.

Program :

Below is the source code for finding the angle of the specified cosine value. The program given is compiled and successfully executed.

Example


Module Module1

    Sub Main()
        Dim angle As Double= 0

        angle = Math.Acos(2)
        Console.WriteLine("Angle of specified cosine value is: {0}", angle)

        angle = Math.Acos(0.3584)
        Console.WriteLine("Angle of specified cosine value is: {0}", angle)

        angle = Math.Acos(0.0)
        Console.WriteLine("Angle of specified cosine value is: {0}", angle)
    End Sub

End Module
	
Output:
Angle of specified cosine value is: NaN
Angle of specified cosine value is: 1.20424285296577
Angle of specified cosine value is: 1.5707963267949

Explanation:

We created a Module1 module in the program above that contains the Main() method. We generated a variable angle initialized with 0 in the Main() method.

angle = Math.Acos(2)
Console.WriteLine("Angle of specified cosine value is: {0}", angle)

angle = Math.Acos(0.3584)
Console.WriteLine("Angle of specified cosine value is: {0}", angle)

angle = Math.Acos(0.0)
Console.WriteLine("Angle of specified cosine value is: {0}", angle)

We find the angle against the specified cosine values in the above code and then print them out on the console screen.


No Sidebar ads