You are not logged in.
Pages: 1
Thanks again gnitsuk,
Indeed you're right, I am tyring to find the overlap of two rectangles.
I have browsed through the internet for the convex-polygon intersection/area of overlapping polygons/area of overlapping objects as suggested but it would really help if I can get to an example of how the algorithm is performed / the foundation implementation of it so that I can code it. I can have a look at my library for the computational geometry books but I need to wait till Monday then. I really need to spend my weekend solving this problem. Does anyone knows any good websites with this info? So far I have been directed to advanced version of the algorithm...
Thanks again.
Hi gnitsuk,
Thanks for your prompt reply. Actually I have done what you have been explaining. It is correct for some cases of two overlapping line segments.
My problem is that my line segments are confined within its endpoints i.e. it has certain lengths. If the intersection angle of these segments is small for example < 10 degree, the overlapping parallelogram is huge compare to its true overlapping area because of the length of both line segments. How can I find th true overlapping area even an approximate value is good enough.
Any idea ? Thanks.
Hi,
I have been cracking my head to find the best solution to solve this problem but had been unsuccessful so far given that I am not that brillinat in Maths either. I hope anyone can help me out.
The problem:
Given two line segments, each have three parameters associated to it that is:
(x1, y1) - first endpoint;
(x2, y2) - second endpoint;
w - line width;
Let say: (x1, y1, x2, y2, w)
Line 1, L1 = (9, 6, 3, 9, 4)
Line 2, L2 = (10, 4, 2, 8, 8)
How can I find the overlapping area of these overlapped segments? As in this case, their slopes are equal but I also have to consider when their slopes are of different values. Is there any generalise solution to these kind of problems?
I have managed to find a generalise solution if both lines are either horizontal or vertical at any point they overlapped on each other. But this proved to be a little harder than that.
Any insights is very much appreciated. Thanks.
Pages: 1