package geoml

  1. Overview
  2. Docs

Module Convex.RegularSource

Module for Regular polygons

Sourcetype t = private {
  1. center : Point.t;
  2. fst : Point.t;
  3. snd : Point.t;
  4. len : float;
  5. apothem : float;
    (*

    Distance between the center and the middle of one of the edges

    *)
  6. edges : int;
}
Sourceval make : Point.t -> Point.t -> int -> t

Create a regular polygon from the center, an arbitrary point and the number of edges

Sourceval next_point : ?nth:int -> t -> Point.t
Sourceval fold_stop : (Point.t -> Point.t -> bool) -> (int -> 'a -> Point.t -> Point.t -> 'a) -> 'a -> t -> 'a
Sourceval perimeter : t -> float
Sourceval area : t -> float
Sourceval to_polygon : t -> polygon
Sourceval to_randomized_polygon : ?minp:int -> ?prob:float -> t -> polygon
Sourceval translate : float -> float -> t -> t
Sourceval transform : Affine.t -> t -> t
Sourceval is_square : t -> bool
Sourceval contains : t -> Point.t -> bool
Sourceval map : (Point.t -> Point.t) -> t -> t