1

I can not figure out how to call the Math.cos function within ruby to do something like this:

cos−1(1)

1 Answer 1

3

According to ruby's math docs the way to use inverse cosine is like this

acos(x) → float

4
  • 2
    No, acosh is inverse hyperbolic cosine. Inverse cosine is acos.
    – Adrian
    Nov 25, 2015 at 22:51
  • Ah thank you :) I looked there too but I could not find it because the function name is very 'shortcuted' and there is not a long description to it with an math example.
    – Dbl
    Nov 25, 2015 at 22:52
  • No prob, hope it helped c:
    – ivan
    Nov 25, 2015 at 22:53
  • Yes, if it was not obvious, acos means arccos. Writing cos-1() wouldn't make sense since - would be interpreted oddly.
    – Charles
    Nov 26, 2015 at 1:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.