Thanks a lot guys for all your suggestions. I learnt quite a bit from your suggestions.
My problem was, I had the degree option selected in calculator instead of 'radians' option when using tan(). I was trying your suggestions one by one only to realise my mistake at the end. Sorry for taking up your valuable time. Please don't be mad at me!!!!!!! Silly me.... Ammy. --- Philip Sheard <[EMAIL PROTECTED]> wrote: > > //All variables are of type double. > > long_diff = fabs(lon1_deg - lon2_deg)/2.0; > //Absolute > > value > > cot1 = 1/(tan((long_diff)/90 * pi/2)); > > > > //cot1 value when I compile thro CW - > > 1206.226660616226 > > with long_diff value 0.04749999999999943 > > > > //Calculator gives me 69111.712627 which is > correct > > b'cos I get the correct distance using this value. > > > > Does anybody have any clue on this behaviour. > > The formula is cot1 = cot(0.0475 * R), where R = > pi/180 = 0.01745329. > > Using the approximation cot(x) ~ 1/x, we have cot1 ~ > 1/(0.0475 * R) = > 1206.227, which is what CW gives. > > Your calculator gives 69111.71 = 1206.227 / R ~ > cot(0.475 * R * R). > > Somewhere you are confusing degrees with radians. > > > > -- > For information on using the Palm Developer Forums, > or to unsubscribe, please see http://www.palmos.com/dev/support/forums/ __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/