1
1
1SLY22020-02-24 13:08:00
C++ / C#
1SLY2, 2020-02-24 13:08:00

How to implement the shape intersection algorithm?

In a nutshell, there are three kinds of shapes (circle, triangle, rectangle), you need an algorithm to check if the shapes intersect.

public override void Draw(Graphics e)
        {
            e.DrawRectangle(new Pen(Color.Black), point.X, point.Y, 100, 50);
        }

Here is a method for drawing one of the shapes. Shapes are drawn from the center of their points, as I understand it. Nothing sensible comes into my head at all. Please help !!!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dobriy_Chelovek3343, 2020-02-24
@Dobriy_Chelovek3343

Alternatively, you can check the color of the pixel for the edges of the matched figure https://docs.microsoft.com/ru-ru/dotnet/api/system... I
also saw the solution of creating a two-dimensional array and checking in this way (type 0 is not filled in 1 is painted over) .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question