First time here? Check out the FAQ!

Ask Your Question
0

Trigonometric simplification for distance on a sphere

asked 11 years ago

Mihai Preda gravatar image

updated 10 years ago

FrédéricC gravatar image

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... ) 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!

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 11 years ago

Volker Braun gravatar image

Doesn't look like they are equal, typo?

sage: diff(0.1, 0.2, 0.3)
-0.264329471853371
Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 11 years ago

Seen: 348 times

Last updated: Jul 21 '13