Z
Z
ZaptoS2016-02-22 22:12:25
Java
ZaptoS, 2016-02-22 22:12:25

Algorithm for checking the complete inclusion of one polygon in another?

Good day! At the moment, he is concerned with finding an algorithm for checking the complete inclusion of one polygon in another. I'm interested in the fidelity of my idea:
- we check in pairs the intersections of the sides of the original polygon with the desired one. If at least 1 pair intersects, then the polygon does not lie entirely inside
+ perhaps there are ready-made implementations of the algorithm in java or at least close to it (so as not to some kind of clojure)?
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
nirvimel, 2016-02-22
@nirvimel

A polygon A lies completely inside a convex polygon B if and only if each of the vertices of A lies inside B.

G
GavriKos, 2016-02-22
@GavriKos

nirvimel gave you the absolutely correct solution. And yours will not work if one polygon is completely outside the other.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question