1
$\begingroup$

I am struggling with the following question. I'd like to check if a point on a circle is between two other points to check if the point is in the boundary. It is easy to calculate when the boundary doesn't go over 360 degrees. But when the boundary goes over 360 degrees (e.g. 270° - 180°), the second point is smaller than the first point of the boundary. And then I don't know how to check if my point on the circle is between the boundary points, because I cannot check "first boundary point" < "my point" < "second boundary point".

Is there an easy way to check this? Either a mathematical function or an algorithm would be good.

  • 2
    http://en.wikipedia.org/wiki/Midpoint_circle_algorithm2011-11-21
  • 7
    You need to decide precisely what kind of "betweenness" you want to determine here. Is north between east and west? Does "between east and west" mean something different from "between west and east"? If so, then how about "between northeast and east" versus "between east and northeast"? If not, then does north suddenly cease to be between east and westish when the westish boundary moves slightly south of due west?2011-11-21
  • 0
    I'm somewhat confused about what exactly you want. Are you looking for a function that will take in 3 points which are known to be on the circle, and classify one of them by its position relative to the other two? Is this in $\mathbb{R^2}$ or $\mathbb{R^3}$? Are they in rectangular or polar coordinates?2011-11-21
  • 1
    'the second point is smaller than the first point' ... what?2011-11-21
  • 0
    Do you mean as you travel counterclockwise (increasing $\theta$)? So $270^o<\theta <360^o$ or $0^o<\theta <180^o$ in your example?2011-11-21
  • 0
    in a circle, given 3 points, p1,p2 and p3; each of them will be "between" the other two points. What is your definition for mid-point?2011-11-21
  • 1
    Hi. Wow, that's a lot of answers. I think it's easier when I say what I want to do with the function. I have a circle with a certain sector blocked. Say for example the sector between 90° and 180° is blocked (@Mike with increasing θ). I now want to check if a point on the circle is in this sector or not to see if it is a valid point or not.2011-11-22

2 Answers 2