Re: Distance point <=> straight line in space
- From: James Dow Allen <jdallen2000@xxxxxxxxx>
- Date: Thu, 31 Jul 2008 02:12:56 -0700 (PDT)
On Jul 31, 1:43 am, Daniel Kraft <d...@xxxxxxxx> wrote:
... I need to calculate ... distance[s] ...
... unfortunatelly, my program spents
a large amount of time (~ 95% of total runtime)
in this routine ...
I believe *many* applications for distance
can be rewritten to use distance-squared
(i.e., don't take square roots); for example
if (distance(me, pizzashop) < TWO_MILES)
order(pizzashop, Hold_anchovies);
becomes
if (sqdist(me, pizzashop) < FOUR_SQ_MILES)
order(pizzashop, Hold_anchovies);
Can your application be so rewritten?
James
.
- Follow-Ups:
- Re: Distance point <=> straight line in space
- From: Daniel Kraft
- Re: Distance point <=> straight line in space
- References:
- Distance point <=> straight line in space
- From: Daniel Kraft
- Distance point <=> straight line in space
- Prev by Date: Re: Distance point <=> straight line in space
- Next by Date: Re: Distance point <=> straight line in space
- Previous by thread: Re: Distance point <=> straight line in space
- Next by thread: Re: Distance point <=> straight line in space
- Index(es):
Relevant Pages
|