Draw point at intersection of two lines or circles on the canvas?

Is there some way to draw a point at the intersection of two lines or circles on the Canvas and find its coordinates?

There are two different ways, depending on which class you are taking:

  • math, or
  • coding

The math way would start at the centers of the circles, drawing a line between centers, then imagining dropping perpendicular lines from the intersection points to that line, then applying rules of trigonometry to the radii of the circles, the angles at the triangles above and below the line, and the Pythagorean Theorem.

The computer class solution is to scan every pixel of the Canvas, calculating its Pythagorean distance from the centers of the circles, and remembering those points whose distances from both centers match both radii., then drawing circles around the points that pass the tests.

So which way do you want?

1 Like

By Coding Method ???

Great.

I laid out the map.

Let us know how far you get.

2 Likes

If you are using DrawCircle function of Canvas, you have the centerX and centerY and radius

(x-centerX1)^2 +(y-centerY1)^2 = radius1^2
(x-centerX2)^2 +(y-centerY2)^2 = radius2^2

then you can get the intersection from these 2 equations.

Some math:



point_circle.aia (5.9 KB)

1 Like

thank you it worked , but how i can extact coordinates of the two points from coordinate list , i want x0 in label and y0 in label and x1 in label and y1 in label seperated to be used after for drawing

No problem, you just need to know how to work with lists:

point_circle2.aia (6.7 KB)

But I think you lack the basic knowledge of programming. Instead of starting with a difficult application, start learning with simple examples and tutorials.

2 Likes

I am a beginner and I am still learning programming. I will analyze the blocks you sent and study them well to understand. Thank you for your efforts anyway