Skip to main content

regular_polygon

Function regular_polygon 

Source
pub fn regular_polygon(
    center: &GeoCoord,
    radius_m: f64,
    sides: usize,
    rotation_deg: f64,
) -> Vec<GeoCoord>
Expand description

Generate a regular N-gon as a closed polygon ring.

§Arguments

  • center – centre of the polygon.
  • radius_m – circumscribed circle radius in meters.
  • sides – number of sides (clamped to min 3).
  • rotation_deg – rotation of the first vertex in degrees clockwise from north.