mardi 29 janvier 2019

Random position outside a box that is inside the circle

I need to find a random position outside a box but is inside a circle, basically the random position between the the box and the circle. What i think of is just rand() a position inside a circle, and check whether the position is outside the box, basically doing a collision check. Is there a more efficient way than this method?




Aucun commentaire:

Enregistrer un commentaire