Skip to content

Commit

Permalink
doc: Clarify Random2D point on a circle
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
Xrayez committed Feb 20, 2022
1 parent d12acb3 commit 913c7bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/Random2D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
By default, generates points inside unit circle with radius [code]1.0[/code]. If you need random normalized vectors, use [member direction] instead, which is more efficient to compute.
If [code]radius_min == 0[/code], generates points inside a unit circle, such that [method Geometry.is_point_in_circle] shall return [code]true[/code] given the same radius.
If [code]radius_min != radius_max[/code], generates points within the ring's area, such that the inner area defined by [code]radius_min[/code] remains unaffected.
If [code]radius_min == radius_max[/code], generates points exactly [b]on[/b] the circle's boundary, but do note that a point may slightly deviate from the actual circle's boundary due to floating point error accumulation.
If [code]radius_min == radius_max[/code], generates points exactly [b]on[/b] the circle's boundary, but do note that a point may slightly deviate from the actual circle's boundary due to floating point error accumulation, so [method Geometry.is_point_in_circle] may occasionally return [code]false[/code].
[codeblock]
var point: Vector2()
var point: Vector2
point = Random2D.point_in_circle(1.0, 1.0) # Unit vector.
point = Random2D.point_in_circle(0.0, 1.0) # Inside a circle.
point = Random2D.point_in_circle(0.5, 1.0) # Within a ring.
Expand Down

0 comments on commit 913c7bd

Please sign in to comment.