Math help needed - Warning complex equation!!....read only if brain is in stable conditon

Jay jranchordas at hotmail.com
Thu Feb 6 09:08:01 EST 2003


right, now that I got your attention, I need help on the following
piece of python code:

distance = 1.15 * (180 * (acos((sin(pi * lat1 / 180) * sin(pi * lat2 /
180)) + (cos(pi * lat1 / 180) * cos(pi * lat2 / 180) * cos(pi * (lon2
– lon1) / 180))) / pi) * 60)

when trying to compile I get the error "SyntaxError: invalid syntax".

Uses Math libray, pi is a defined constant (lat1, lat2, lon1, lon2 are
variables - two sets of latitude and longitude values)

Using Linux Red Hat 8.0, Python 2.2.2

I've counted the number of brackets (11 in total both sides) there and
they do match, so I can't really see anything obviously wrong with
this.

there is a handsome reward available for the solution
provided....(hehehhe)




More information about the Python-list mailing list