# 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

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)

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.

1

the help of comand says:

RandomPointIn( )

Creates a random point inside given polygon or conic.

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.

Leave a Comment
• GeoGebra
• Help
• Partners
• Contact us
• Feedback & Questions
• This email address is being protected from spambots. You need JavaScript enabled to view it.
• +43 677 6137 2693
© 2022 International GeoGebra Institute