Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] Re: directional system: more magic code cleanups
Home

[Freeciv-Dev] Re: directional system: more magic code cleanups

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>, jdorje@xxxxxxxxxxxxxxxxxxxxx, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: directional system: more magic code cleanups
From: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Date: Wed, 26 Sep 2001 00:36:19 -0400

At 10:19 AM 01/09/25 +0200, Raimar Falke wrote:
>On Tue, Sep 25, 2001 at 03:11:26AM -0400, Ross W. Wetmore wrote:
>> At 09:12 AM 01/09/24 +0200, Raimar Falke wrote:
>Ok. However every piece of code which will get into cvs will be
>reformatted.

You obfuscated by you, right?

>Ok. From a test game:
>
>2: src=(43,4) dest=50,7)
>2:   orig=SE, jason=SE, ross=E, raimar=SE, raimar2=SE
>
>So we see that diff_x=7 diff_y=3. So we have a gradient of
>m=diff_y/diff_x=3/7.
>
>Now comes the tricky part where your error is: which gradient is the
>border between the SE part and the E part? I think your answer would
>be 0.5. Probably because m=1 divides the quadrant. And 1/2 would
>quarter the quadrant. THIS IS WRONG. The correct gradient is
>tan(pi/8)=0.4142... It is now no surprise that the gradient from above
>m=3/7=0.42857... is between 0.4142 and 0.5.

Raimar LOOK AT your numbers. You need to move 7 east and 3 south. It
should be clear as mud that the straightest direction looks like this
with the first move to the EAST.

 0 1 . . . . . .
 . . 2 3 . . . .
 . . . . 4 5 . .
 . . . . . . 6 7

Your trig functions are clearly a bit out of whack. Do you know why?

>Has this showed up during your testing? No. This is not
>surprising. The example of the useless code in goto_zoc_ok should us
>teach that you have to "really" test a method which can not easily be
>tested by the gui.

Yes Raimar. We see how well you tested your 3 buggy algorithms. 

>Did I expect that you find this error by yourself after pointing out
>that there are differences (I didn't say error here)? Yes.

Did you read the section on trig vs game distances that you dropped
from the reply???  Do you now understand what this was telling you?

>So if you come up with a new version of your method I will be happy to
>test and profile it.

I hope you come up with a new version that agrees with mine, or stop
this nonsense and just admit that you hasve a bit more to learn in
some things, and pay attention when people tell you something.

>       Raimar
>
>-- 
> email: rf13@xxxxxxxxxxxxxxxxx
> 1 + 1 = 3, for large values of 1

Cheers,
RossW




[Prev in Thread] Current Thread [Next in Thread]