# `Visualize.Geo.Circle`
[🔗](https://github.com/dcoai/Visualize/blob/v0.8.3/lib/visualize/geo/circle.ex#L1)

A circle on the sphere as a GeoJSON `Polygon`: d3-geo's `geoCircle` (spec/07 §2.5, D-131).

`polygon/1` returns the small circle of angular `radius` degrees about `center`, as
`%{"type" => "Polygon", "coordinates" => [ring]}`, one ring of `[lon, lat]` positions in
degrees. The ring is d3-geo 3.1.1's, point for point and in d3's order and winding, so
`Visualize.Geo.Path`, which clips on the sphere as d3 does (spec/07 §2.2.1, D-127), fills
the cap of `radius` about `center` under every projection — a hemisphere at 90°.

    iex> %{"type" => "Polygon", "coordinates" => [ring]} =
    ...>   Visualize.Geo.Circle.polygon(center: [0, 0], radius: 10, precision: 90)
    iex> length(ring)
    5

The ring starts at the circle's angle `radius` about its axis, not at its southernmost
point, and runs every `precision` degrees back round to it, as d3's does.

Options:

  * `:center` — `[lon, lat]` in degrees (default `[0, 0]`)
  * `:radius` — the angular radius in degrees (default `90`)
  * `:precision` — the step between the ring's points, in degrees of the circle's own
    angle (default `6`); `0` gives an empty ring, as in d3

# `position`

```elixir
@type position() :: [float()]
```

# `t`

```elixir
@type t() :: %{required(String.t()) =&gt; String.t() | [[position()]]}
```

# `polygon`

```elixir
@spec polygon(keyword()) :: t()
```

The circle of `radius` degrees about `center`, every `precision` degrees, as a GeoJSON
`Polygon` (spec/07 §2.5).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
