Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2004:
[Freeciv-Dev] (PR#9043) map_vector_to_sq_distance function
Home

[Freeciv-Dev] (PR#9043) map_vector_to_sq_distance function

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#9043) map_vector_to_sq_distance function
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 20 Jun 2004 16:48:32 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9043 >

> [glip - Sun Jun 20 18:03:41 2004]:
> 
> On Sun, 20 Jun 2004, Jason Short wrote:
> 
> > In three places the formula for determining "square distance" is coded
> > as a pythagorean distance:
> >
> >    dx * dx + dy * dy
> >
> > This patch unifies those into one function, map_vector_to_sq_distance.
> 
> Why such a name though?
> I would suggest vector_mod_sq or vector_norm_sq or vector_length_sq for
> laymen.

I dunno, sq_distance seems obvious enough to me.  That's what it's
called already (in sq_map_distance)  I have no idea what mod_sq or
norm_sq means (well, not without resorting to math training anyway).

As for the xxx_to_xxx() "conversion" naming method, I have no real
opinion - it just seemed natural at the time.

Maybe get_vector_length_sq()?  vector_get_visual_distance_sq()?

jason



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