Is there an algorithm for finding nearby points using only polar coordinates?

Suppose I have a vector of points in the form of polar coordinates.

Suppose one of these points acts like a probe, for which I want to find all the other points at a certain distance.

Is there an algorithm for this without converting them to Cartesian?

+5
source share
2 answers

You are looking for a distance for polar coordinates. You can find the formula in this link .

The distance between points (r1, a1) and (r2, a2) is equal to:

D = sqrt(r1*r1 + r2*r2 - 2*r1*r2*cos(a1-a2))
+7
source

, , . , , /. , :

  • ,
  • , ,

, .

:

  • :

    • :
    • , , O (1) ( , , ...) / ( , ).
  • :

    • - O (n);
    • ( , n ).

, .

+2

All Articles