Path: utzoo!utgpu!water!watmath!clyde!att!pacbell!ames!ll-xn!olsen From: olsen@XN.LL.MIT.EDU (Jim Olsen) Newsgroups: comp.mail.uucp Subject: Re: lattitute/longitude problem Keywords: latitude longitude C Message-ID: <1055@xn.LL.MIT.EDU> Date: 21 Jul 88 13:36:01 GMT References: <256@telly.UUCP> Reply-To: olsen@xn.UUCP (Jim Olsen) Organization: MIT Lincoln Laboratory, Lexington, MA Lines: 5 Here is a C expression which calculates the great-circle distance from point (lat1,lon1) to point (lat2,lon2). All quantities are in radians. To convert the distance to kilometers, multiply by 6367. distance = acos(cos(lat2-lat1) * cos((lon2-lon1)*cos(lat1)));