Hello

I'm trying to generate randomly placed squares on a canvas with a given area such that they have random rotations and they should not overlap.

something like this : https://forum.processing.org/topic/help-random-distribution-of-non-overlapping-circles

I can think of a way of doing checking the overlapping condition if the squares are aligned to the axes, however I am stumped about how to go about rotating my squares and still be able to check if two squares are overlapping.

One idea I had was to create my own rotation matrices while generating the squares, but is there a better way?

I'm trying to generate randomly placed squares on a canvas with a given area such that they have random rotations and they should not overlap.

something like this : https://forum.processing.org/topic/help-random-distribution-of-non-overlapping-circles

I can think of a way of doing checking the overlapping condition if the squares are aligned to the axes, however I am stumped about how to go about rotating my squares and still be able to check if two squares are overlapping.

One idea I had was to create my own rotation matrices while generating the squares, but is there a better way?

1