Learn creative coding writing simple programs

60. Are two circles touching or intersecting?

Use the dist() function to calculate the distance between two points in the screen. Why would you want to do that? Well, you can use the distanceto know if two circles are overlapping. If the distance between the centers of the circles is less than the radius of the first circle plus the radius of the second circle, then they are touching.
The radius of a circle is the distance between the center of the circle and any point in the circle itself.

Tags: dist, distance, two, points, interescting, circles, touching, software tutorial

Code editor

You can make changes to the code below. Then
Questions and comments are welcome! :) But please try to stay close to the topic of this episode. Use the Processing forums for help with your Processing projects (or hire me for help ;-)