dimanche 4 janvier 2015

Law of cosines proof help


Hi i have one question on my project. I am assuming earth is a perfect sphere How can i get from (law of cosines) cos(c)=cos(latA)cos(latb)+sin(lata)sin(latb)cos(longb-Longa) to cos(c)=cos(latA)cos(latB)cos(lonB-lonA)+sin(latA)sin(latB)


I would love any help.. i have tried for hours but cant find how to obtain the second law of cosines form. i have gotten some help from http://ift.tt/1xHViKX but i do not understand how to get the coordinates of B.


his can be done very easily by using the scalar product of two vectors to find the angle between those vectors. Let the vectors be OA and OB, where A and B are the two points on the surface of the earth and O is the centre of the earth. The scalar product gives


OAOBcos(AOB) = R^2*cos(AOB)


where R = radius of the earth. Having found angle AOB the distance between the points is R*(AOB) with AOB in radians.


To find the scalar product we need the coordinates of the two points.

Set up a three-dimensional coordinate system with the x-axis in the longitudinal plane of OA, the xy plane containing the equator, and the z-axis along the earth's axis. With this system, the coordinates of A will be


Rcos(latA), 0, Rsin(latA)


and the coordinates of B will be


Rcos(latB)cos(lonB-lonA),Rcos(latB)sin(lonB-lonA),Rsin(latB)


The scalar product is given by


xAxB + yAyB + zA*zB = R^2cos(latA)cos(latB)cos(lonB-lonA)+ R^2sin(latA)sin(latB)


Dividing out R^2 will give cos(AOB)


cos(AOB)=cos(latA)cos(latB)cos(lonB-lonA)+sin(latA)sin(latB)


This gives AOB, and the great circle distance between A and B will be


R*(AOB) with AOB in radians.





Aucun commentaire:

Enregistrer un commentaire