Thursday, January 18, 2018

java - Algorithm to verify if a shape is inside another


I have a rectangular canvas and I need to verify whether a shape is totally inside that canvas or not. The shape can be lines, ellipses, arcs, rectangles and arbitrary polygons.


Does anyone know a lib with this kind of algorithm, preferably in java?


I searched and found just Slick2D, but it has a bug exactly on the method that verify if shape contains another shape.


Just to exemplifly, in the figure only shapes 2, 4, 5, and 7 are inside the canvas.


enter image description here





No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...