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
Below you can ask and answer questions related to this video. If your question is unrelated to the video, please post it at the Processing Forum as I'm unable to help with all of your programs and still have enough free time to eat and sleep :)
comments powered by Disqus