1
$\begingroup$

I am looking for a good method to find out if a specified point lies within a specified circle. The situation looks as follows:

Where the line at r has a given heading (60°). I now want to find out, if point E and F lie within this half of the circle. E does, F does not.

The center of the circle and the points E/F are given by coordinates X/Y, so the circle center is not 0/0.

Situation

What would be the best performing way to find out?

$\endgroup$
4
  • 1
    $\begingroup$ Translate the circle to the origin and look at the angle the points make with the $x$-axis. Simple and computationally fast. $\endgroup$ Dec 29, 2013 at 1:14
  • 1
    $\begingroup$ How to tell if a point lies in a given sector of a circle ? Hmmm... I guess that would depend on whether there are laws in that specific sector which prohibit the use of torture in the process of extracting the truth... If the latter, then kidnapping the point and bringing it to a secure location situated in a sector where said things are allowed might be a good way (though perhaps not necessarily the best) of getting to the bottom of things, and establishing once and for all whether what the point says is indeed true or not... $\endgroup$
    – Lucian
    Dec 29, 2013 at 1:14
  • $\begingroup$ Hilarious ^^ Don't joke about my poor english :-P $\endgroup$ Dec 29, 2013 at 10:49
  • 1
    $\begingroup$ Your English is crystal; the two words are homonymic. :-) $\endgroup$
    – Lucian
    Dec 29, 2013 at 23:14

1 Answer 1

2
$\begingroup$

Scalar product:

In the picture $X$ denoted the center of the circle, the coordinates of $\vec XB$ are obtained by performing $B-X$ coordinatewise.

Now, we have $\vec{XB}\cdot\vec{XE}>0$ iff $E$ lies in the same halfplane as $B$, (then $\vec{XB}\cdot\vec{XE}=0$ iff $XB\perp XE\ $ and $\ \vec{XB}\cdot\vec{XE}<0$ iff $E$ lies in the other halfplane).

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .