take the arccosine of a number in ruby

To take the arccosine of a number in Ruby, you can use the acos method from the Math module. Here's an example:

main.rb
number = 0.5
arccosine = Math.acos(number)
puts arccosine
58 chars
4 lines

In this example, we're taking the arccosine of 0.5 and storing it in arccosine. We then print the result to the console. You can replace 0.5 with any number you'd like to find the arccosine of.

gistlibby LogSnag