Search code examples
ruby

Convert degree to radians in ruby


I have a latitude and longitude in degrees and I want to convert these into radians. How can I do that? Any inbuilt method?


Solution

  • Just the same way you convert degrees to radians in real life:

    radians = degrees * Math::PI / 180