identify intersection & correct

Hi,
I have to write a program, which will identify shape(this is combination of rectangle & traingle) intersecting with same shape. If they are intersecting, move them horizontaly so that they cant intersect. I have n no. of such shapes in one plane, with origin please help
Thanks
Have a class type storing a shape. The necessary details of one shape.


Have a function that takes two shape objects and returns a bool:
true, if they intersect -- false, if not. Shape intersection is math. Hide it into the function.
Thanks for the reply!
My question is not clear, I will make it correct
.Suppose I have 3 circles intersecting( there x coordinate will only differ, y will remain same). so now I have to move 2nd & 3rd circle to the right(with the intersection distance), so that they are aligned horizontally without intersection. My first circle(x,y)will remain same, only circles intersected horizontally have to be shifted right.

now circles can be 2,3 ,4 etc. aligned horizontally with/without intersection
Do you mean something like:
1
2
C2.x = C1.x + C1.radius + C2.radius;
C3.x = C2.x + C2.radius + C3.radius;
Topic archived. No new replies allowed.