randomPointIn not confined to semicircle

twirl shared this question 4 years ago
Answered

I have found that the randomPointIn command applied to a semicircle sometimes creates a point outside the semicircle (seems to be confined to within the circle?) whereas the PointIn command creates a point which is confined to the semicircle.


I'm not sure if this is a bug? If not is there an alternative means of creating a random point within a semicircle?


Thanks for any help.

Best Answer
photo

I think semicircle is not an object ( there are objects an display of objects; function(x^2,2,4) is an example)

alternative: create B=randomPointIn(), the reflect of B in center or in diameter of circle; then If() comand for selecting the desired point.

Comments (3)

photo
1

I think semicircle is not an object ( there are objects an display of objects; function(x^2,2,4) is an example)

alternative: create B=randomPointIn(), the reflect of B in center or in diameter of circle; then If() comand for selecting the desired point.

photo
1

the help of comand says:

RandomPointIn( )

Creates a random point inside given polygon or conic.

photo
1

Ah yes I see now it is a deliberate distinction in that PointIn also includes arcs in the defined regions. Thanks for your solution.

© 2022 International GeoGebra Institute