# Constrained random points on a circle

Generates an EPS file.

```ruby
var points = []
while (points.len < 100) {
    var (x, y) = 2.of{ 30.irand - 15 }...
    var r2 = (x**2 + y**2)
    if ((r2 >= 100) && (r2 <= 225)) {
        points.append([x, y])
    }
}

print <<'HEAD'
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox 0 0 400 400
200 200 translate 10 10 scale
0 setlinewidth
1 0 0 setrgbcolor
0 0 10 0 360 arc stroke
0 0 15 360 0 arcn stroke
0 setgray
/pt { .1 0 360 arc fill } def
HEAD

points.each { |pt| say "#{pt.join(' ')} pt" }
print '%%EOF'
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://trizen.gitbook.io/sidef-lang/programming_tasks/c/constrained_random_points_on_a_circle.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
