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 <prashanthhirema...@gmail.com> > > 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())*60*1.1515*1.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 > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---