Re: VHTransform.distance error

From: Donald Dietrick <dietrick@bbn.com>
Date: Mon Sep 10 2001 - 20:07:05 EDT

Thanks Chinh!

On Monday, September 10, 2001, at 06:11 PM, Chinh Tang wrote:

> Hi all,
> I guess not many people use this function so the error was not found
> earlier.
>
> The distance method in VHTransform looks like this.
>
> /** Return the distance in miles between 2 VH pairs. **/
> public static double distance
> (double v1, double h1, double v2, double h2) {
> double dv = v2 - v1;
> double dh = h2 - h1;
> return Math.sqrt(dv*dv + dh*dh)/10.0; }
>
> The error is in the last line.
> It should divid by 10 before doing sqrt like this
> return Math.sqrt((dv*dv + dh*dh)/10);
>
> for
> VH(8426,4049) Dallas,TX
> VH(8996,3992) Austin,TX
> the old formula returns 57.8miles
> the correct formula returns 181miles which is close enough if we
> started with
> correct VH
>
> --
> [To unsubscribe to this list send an email to "majdart@bbn.com"
> with the following text in the BODY of the message "unsubscribe
> openmap-users"]
>

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Donald F. Dietrick, dietrick@bbn.com
BBN Technologies, 10 Moulton Street, Cambridge, MA 02138
617.873.3031 FAX 2794
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
[To unsubscribe to this list send an email to "majdart@bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Mon Sep 10 20:07:59 2001

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:31 EDT