Tag Archives: collision detection

Finding Collisions of Circles and Line Segments in Javascript

The JavaScript program below creates a field full of circles and line segments of random size, position, and velocity, and calculates and displays the collisions between them. To see the code in action, copy it into an .html file and … Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment

Finding Collisions of Circles in JavaScript

The JavaScript program below creates a field full of circles of random size, position, and velocity, and calculates and displays the collisions between them. To see the code in action, open it in a web browser that runs JavaScript.

Posted in Uncategorized | Tagged , , , , | Leave a comment

Detecting Collisions of Shapes in JavaScript

The JavaScript program below, when run, displays a wraparound playfield filled with squares moving in random directions at random speeds and rotating at random rates. When two squares overlap, the collisions between them are highlighted with small circles. The program … Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment