LumH
LumH

Reputation: 11

geotools - creating a fan shape

I'm new to using geotools, and I would like to be able to draw fan shape - just the outline of the blue area.

Fan shape example

The parameters are:

  1. Inner radius
  2. Outer radius
  3. Anchor position (centre)
  4. Start sector angle
  5. End sector angle

Appreciate your help!

Upvotes: 0

Views: 144

Answers (1)

LumH
LumH

Reputation: 11

Thanks, Ian!

I modified the algorithm in your link to just create an arc (left to right) from a given radius, startAngle, sectorAngle to return an array of Coordinates.

I would create an arc with the outer radius, then create the 2nd arc with the inner radius. I would combine the 2 two arrays by adding the inner radius arc in reverse, then I would add the first point of outer radius arc to close the polygon.

Upvotes: 1

Related Questions