First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Trigonometric simplification for distance on a sphere

These are two equivalent equations for distance on a sphere:

hav(x)=sin(x/2)^2

dist1(lat1, lat2, dLon)=2asin(hav(lat1-lat2)+cos(lat1)cos(lat2)*hav(dLon))

dist2(lat1, lat2, dLon)=acos(sin(lat1)sin(lat2)+cos(lat1)cos(lat2)*cos(dLon))

(According to http://www.movable-type.co.uk/scripts/latlong.html ) Indeed numerically they evaluate equal.

But why their difference does not simplify to 0?

diff(x,y,z)=dist1(x,y,z)-dist2(x,y,z)

diff.simplify_full()

Am I doing something wrong? Is there a way to have Sage prove the two forms are equivalent, or to transform one to another?

Thanks!

click to hide/show revision 2
No.2 Revision

updated 11 years ago

calc314 gravatar image

Trigonometric simplification for distance on a sphere

These are two equivalent equations for distance on a sphere:

hav(x)=sin(x/2)^2

hav(x)=sin(x/2)^2
  

dist1(lat1, lat2, dLon)=2asin(hav(lat1-lat2)+cos(lat1)cos(lat2)*hav(dLon))

dLon)=2*asin(hav(lat1-lat2)+cos(lat1)*cos(lat2)*hav(dLon))

dist2(lat1, lat2, dLon)=acos(sin(lat1)sin(lat2)+cos(lat1)cos(lat2)*cos(dLon))

dLon)=acos(sin(lat1)*sin(lat2)+cos(lat1)*cos(lat2)*cos(dLon))

(According to http://www.movable-type.co.uk/scripts/latlong.html ) Indeed numerically they evaluate equal.

But why their difference does not simplify to 0?

diff(x,y,z)=dist1(x,y,z)-dist2(x,y,z)

diff(x,y,z)=dist1(x,y,z)-dist2(x,y,z)
  

diff.simplify_full()

diff.simplify_full()

Am I doing something wrong? Is there a way to have Sage prove the two forms are equivalent, or to transform one to another?

Thanks!

click to hide/show revision 3
retagged

updated 10 years ago

FrédéricC gravatar image

Trigonometric simplification for distance on a sphere

These are two equivalent equations for distance on a sphere:

hav(x)=sin(x/2)^2

dist1(lat1, lat2, dLon)=2*asin(hav(lat1-lat2)+cos(lat1)*cos(lat2)*hav(dLon))

dist2(lat1, lat2, dLon)=acos(sin(lat1)*sin(lat2)+cos(lat1)*cos(lat2)*cos(dLon))

(According to http://www.movable-type.co.uk/scripts/latlong.html ) Indeed numerically they evaluate equal.

But why their difference does not simplify to 0?

diff(x,y,z)=dist1(x,y,z)-dist2(x,y,z)

diff.simplify_full()

Am I doing something wrong? Is there a way to have Sage prove the two forms are equivalent, or to transform one to another?

Thanks!