0
$\begingroup$

Given

A Quad($C$, $D$, $E$, $B$) and Points $A$, $G$, $F$

Question

Is it possible by calculating the angles between points to determine whether a point is inside (including on), or outside the quad

Observations:

Off the top of my head it looks like

$\angle CFB + \angle CFD + \angle DFE + \angle EFB = 360 ^{\circ} $

$\angle CGD = 180 ^{\circ}$ and the other angles: $\angle CGB + \angle BGE + \angle EGD = 180 ^{\circ} $

Is this a valid way to test whether a point lies inside a quad? I can't seem to come up (in my head) with a situation in which the angles from point A would total $360 ^{\circ}$ as well

enter image description here

Side Note:

I'm hoping to use this information to turn this into a little software routine in python (which it now occurs to me might be subject to rounding errors...)

$\endgroup$
  • 1
    $\begingroup$ ?? typo ∠CGB+∠BGE+∠EGD=180 $\endgroup$ – oks Dec 24 '14 at 11:03
  • $\begingroup$ fixed... thanks $\endgroup$ – Jeef Dec 24 '14 at 11:26
0
$\begingroup$

Don't know if you can do it just with angles (e.g. what if the quadrilateral has a reflex angle in it?) But any quadrilateral can be split into two triangles (e.g. BCD and BDE for your notation). Then your problem reduces to determining if a point is an interior or boundary point of either of the triangles.

How to determine some points are inside or outside in triangle

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.