[Freeciv-Dev] Re: directional system: more magic code cleanups
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
--- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> On Mon, Sep 17, 2001 at 11:13:03AM +0100, Gregory Berkolaiko wrote:
> > there is a nice mathematical way to code dir_ok:
> > if diff_x, diff_y and dir are what they are in the current function
> > then the "scalar product"
> >
> > diff_x*DIR_DX[dir] + diff_y*DIR_DY[dir]
> >
> > is positive whenever direction is ok. And you don't need any
> switches.
>
> Very nice. Good spotting. For clarity: s/positive/>=0/. There may be
oops! I thought only 3 directions are ok
obviously I didn't read the comment :(
> extra documentation about this (for a given diff vector there are
> exactly 5 directions ok. These are centered around the given diff
> vector. The "outmost" still valid directions are orthogonal to the
> given diff vector. scalar product bla bla ...)
>
> > However Ross' patch might be more advanced than this.
>
> No I don't think so ;)
well, I think he had some crafty way to implement straightest direction
and then he would compare dir with the straightest_dir. This cuts out
the computation of diff_x and diff_y and can therefore be faster / more
portable. Anyway, let's wait until he wakes up and checks his mail :)
G.
____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie
- [Freeciv-Dev] directional system: more magic code cleanups, Jason Dorje Short, 2001/09/17
- [Freeciv-Dev] Re: directional system: more magic code cleanups, Raimar Falke, 2001/09/17
- [Freeciv-Dev] Re: directional system: more magic code cleanups, Gregory Berkolaiko, 2001/09/17
- [Freeciv-Dev] Re: directional system: more magic code cleanups, Raimar Falke, 2001/09/17
- [Freeciv-Dev] Re: directional system: more magic code cleanups,
Gregory Berkolaiko <=
- [Freeciv-Dev] Re: directional system: more magic code cleanups, Raimar Falke, 2001/09/17
- [Freeciv-Dev] Re: directional system: more magic code cleanups, Gregory Berkolaiko, 2001/09/17
- [Freeciv-Dev] Re: directional system: more magic code cleanups, Raimar Falke, 2001/09/17
- [Freeciv-Dev] Re: directional system: more magic code cleanups, Jason Dorje Short, 2001/09/17
- [Freeciv-Dev] Re: directional system: more magic code cleanups, Raimar Falke, 2001/09/17
- [Freeciv-Dev] Re: directional system: more magic code cleanups, Jason Dorje Short, 2001/09/17
- [Freeciv-Dev] Re: directional system: more magic code cleanups, Raimar Falke, 2001/09/18
- [Freeciv-Dev] Re: directional system: more magic code cleanups, Jason Dorje Short, 2001/09/18
- [Freeciv-Dev] Re: directional system: more magic code cleanups, Ross W. Wetmore, 2001/09/18
- [Freeciv-Dev] Re: directional system: more magic code cleanups, Ross W. Wetmore, 2001/09/18
|
|