Re: VHTransform.distance error

From: Ken Anderson <kanderson@bbn.com>
Date: Mon Sep 10 2001 - 20:32:53 EDT

While such an error might have crept in while converting from C,
I find dividing the square of the distance by 10 more unusual than dividing the distance by 10, I think we need to write more than one test case for VHTransform.

At 08:07 PM 9/10/2001, Donald Dietrick wrote:
>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"]
>

--
[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:34:26 2001

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