GDI+ randomly select point on a drawn circle
-
This is another GDI+ question: Does anyone know how it is possible to randomly /select/draw/get coordinates of/ a point on a circle line of drawn circle? Thanks in advance, Sincerely, Max Pastchenko
-
This is another GDI+ question: Does anyone know how it is possible to randomly /select/draw/get coordinates of/ a point on a circle line of drawn circle? Thanks in advance, Sincerely, Max Pastchenko
do you know the center and radius of the circle ? Cleek | Image Toolkits | Thumbnail maker
-
This is another GDI+ question: Does anyone know how it is possible to randomly /select/draw/get coordinates of/ a point on a circle line of drawn circle? Thanks in advance, Sincerely, Max Pastchenko
You question is not entirely clear. From a general perspective if you need to generate a random point on the circumference of a circle you could generate a random number between [0,360)and then, given that you know the radius and centerpoint of the circle transform your random angle to get the coordinates you need. I do not know what built in function there are for this, but simple geometry will give you the coordinates. You know the origin (centerpoint of your circle) which is a general (x,y) pair. You now also know the angle of a triangle and the length of the hypotenuse. Use trig to compute the x and y offsets: r * sin(theta) = y; r * cos(theta) = x. I hope this helps. Check my math, my trig my be rusty.
-
You question is not entirely clear. From a general perspective if you need to generate a random point on the circumference of a circle you could generate a random number between [0,360)and then, given that you know the radius and centerpoint of the circle transform your random angle to get the coordinates you need. I do not know what built in function there are for this, but simple geometry will give you the coordinates. You know the origin (centerpoint of your circle) which is a general (x,y) pair. You now also know the angle of a triangle and the length of the hypotenuse. Use trig to compute the x and y offsets: r * sin(theta) = y; r * cos(theta) = x. I hope this helps. Check my math, my trig my be rusty.
This is quite helpful. Thank you Sincerely, Max Pastchenko