mardi 20 août 2019

How to get random points from a circle?

I am trying to develop a project with a measurement sensor(simulated) with two motors one for horizontal movement and one for the vertical movement of the sensor. Following figure illustrates the example measurement in a 3D space, for horizontal angle (HA) of 0 degrees and vertical angle (VA) of zero degrees.

enter image description here

Since beam divergence is not considered in the software, I would like to form a footprint circle of diameter D at distance R from the sensor and shoot lasers 10 more times randomly within this circle from software(Cpp). How can I randomly select 10 points within this circle?(i.e how can I have ten random values for HA and VA so that :

HA - D/2 < HA_temp[10] < HA + D/2 
VA - D/2 < VA_temp[10] < VA + D/2

I would also like to know if there are any perticular libraries available to make it easy in Cpp or specifically in unreal engine 4.




Aucun commentaire:

Enregistrer un commentaire