Main Object error

Hi i am applying the formula to find the surrounding distance within 10
km
using ruby

geokit

x=((((acos(sin((’#{lat}’*pi()/180)) *
sin((latitude*pi()/180))+cos((’#{lat}’*pi()/180)) *
cos((latitude*pi()/180)) * cos(((’#{lng}’-
longitude)*pi()/180))))180/pi())601.15151.609344) <= 10)

NoMethodError: undefined method `pi’ for main:Object

Am getting this error help me to solve this.ANd morever i ma not
connected
to any databse\

Regsrda
prashanth

Use Math::PI; please use Google more often.

BTW, I hope you understand sin(’#{lat}’) is also wrong because of
multiple reasons - but if you don’t, I should leave it to you to
figure out.


अभिनव
http://twitter.com/abhinav

2009/9/16 prashanth hiremath [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs