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: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Cc: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: directional system: more magic code cleanups
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 25 Sep 2001 16:45:17 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Tue, Sep 25, 2001 at 02:27:04PM +0100, Gregory Berkolaiko wrote:
> If you do not mind I will make a few comments about your discussion.
> 
> First of all, it is not as friendly as I think it should be.  I can feel
> quite a lot of irritation, especially in Ross' emails.  I am sure it can
> be avoided.

Mhh yes it looks so. I'm sorry for this.

> Second, the difference between Ross' and Raimar's algorithms is the
> difference between 26.6 degrees and 22.5 degrees.

Correct.

> Not much is it?

> Third, in the below example,
> ===============================================================
>  --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote: 
> > 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.
> ===============================================================
> E is the more correct answer than SE.  The complicated explanation is
> given in Ross' email about differences between trigonometry and
> God-knows-what.

You get give me url or subject and date of an email which has a good
explanation of this?

> The simple explanation is provided by the attached figure. I hope
> you agree that the best division of the tiles of the 3rd outer
> circle is the one drawn: each direction has 3 tiles.  If you carry
> this division further, to the 7th circle, you will find that (7,3)
> is East.

Yes this is nice figure. But this is no invalidation of basic
trigonometry. There may be special freeciv properties which make the
pure trigonometry approach sub-optimal but I don't know this property
or haven't understood it yet. So please go ahead and try to teach me.

> Four, since the difference is not so terribly crucial, one should go for
> the fastest algorithm.  Which, as I understand from the profile, is
> Ross'. But it looks like a cryptographer's nightmare.  I would not have
> the brainpower to read such thing, unless it is really well commented.

So how much falsity do we want to trade against performance? 
No. Either we leave the current version (which is also wrong but fast,
even faster then the version of Ross) or we change it to be correct
(this doesn't have to be the trigonometry solution).

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Premature optimization is the root of all evil."
    -- D. E. Knuth in "Structured Programming with go to Statements"


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