<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Polygon (geoml.Geoml.Polygon)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.1.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> â€“ <a href="../../index.html">geoml</a> &#x00BB; <a href="../index.html">Geoml</a> &#x00BB; Polygon</nav><header class="odoc-preamble"><h1>Module <code><span>Geoml.Polygon</span></code></h1><p>This module provides basic functions for any concave, convex and convex regular polygon (Does not handle complex polygon and polygon with holes)</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type" id="type-t" class="anchored"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span><span> = <span class="keyword">private</span> <span><a href="../Point/index.html#type-t">Point.t</a> list</span></span></code></div></div><div class="odoc-spec"><div class="spec type" id="type-polygon" class="anchored"><a href="#type-polygon" class="anchor"></a><code><span><span class="keyword">type</span> polygon</span><span> = <a href="#type-t">t</a></span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-make" class="anchored"><a href="#val-make" class="anchor"></a><code><span><span class="keyword">val</span> make : <span><span><a href="../Point/index.html#type-t">Point.t</a> list</span> <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-first_point" class="anchored"><a href="#val-first_point" class="anchor"></a><code><span><span class="keyword">val</span> first_point : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="../Point/index.html#type-t">Point.t</a></span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-to_list" class="anchored"><a href="#val-to_list" class="anchor"></a><code><span><span class="keyword">val</span> to_list : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="../Point/index.html#type-t">Point.t</a> list</span></span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-fold" class="anchored"><a href="#val-fold" class="anchor"></a><code><span><span class="keyword">val</span> fold : <span><span>( <span><span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="../Point/index.html#type-t">Point.t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="../Point/index.html#type-t">Point.t</a> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span> )</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span></span></code></div><div class="spec-doc"><p>Same function as <code>List.fold_left</code> but on segments of a given polygon</p></div></div><div class="odoc-spec"><div class="spec value" id="val-fold_filter" class="anchored"><a href="#val-fold_filter" class="anchor"></a><code><span><span class="keyword">val</span> fold_filter : 
  <span><span>( <span><a href="../Point/index.html#type-t">Point.t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="../Point/index.html#type-t">Point.t</a> <span class="arrow">&#45;&gt;</span></span> bool )</span> <span class="arrow">&#45;&gt;</span></span>
  <span><span>( <span><span class="type-var">'b</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="../Point/index.html#type-t">Point.t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="../Point/index.html#type-t">Point.t</a> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'b</span> )</span> <span class="arrow">&#45;&gt;</span></span>
  <span><span class="type-var">'b</span> <span class="arrow">&#45;&gt;</span></span>
  <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span>
  <span class="type-var">'b</span></span></code></div><div class="spec-doc"><p>Same function as <code>fold</code> but filters segments with the first argument</p></div></div><div class="odoc-spec"><div class="spec value" id="val-perimeter" class="anchored"><a href="#val-perimeter" class="anchor"></a><code><span><span class="keyword">val</span> perimeter : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> float</span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-area" class="anchored"><a href="#val-area" class="anchor"></a><code><span><span class="keyword">val</span> area : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> float</span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-proj_x" class="anchored"><a href="#val-proj_x" class="anchor"></a><code><span><span class="keyword">val</span> proj_x : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> float * float</span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-proj_y" class="anchored"><a href="#val-proj_y" class="anchor"></a><code><span><span class="keyword">val</span> proj_y : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> float * float</span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-translate" class="anchored"><a href="#val-translate" class="anchor"></a><code><span><span class="keyword">val</span> translate : <span>float <span class="arrow">&#45;&gt;</span></span> <span>float <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-transform" class="anchored"><a href="#val-transform" class="anchor"></a><code><span><span class="keyword">val</span> transform : <span><span class="xref-unresolved">Geoml__Affine.t</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-minmax_xy" class="anchored"><a href="#val-minmax_xy" class="anchor"></a><code><span><span class="keyword">val</span> minmax_xy : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> float * float * float * float</span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-intersect_line" class="anchored"><a href="#val-intersect_line" class="anchor"></a><code><span><span class="keyword">val</span> intersect_line : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="../Line/index.html#type-t">Line.t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="../Point/index.html#type-t">Point.t</a> list</span></span></code></div><div class="spec-doc"><p>returns the intersection point of a line and a polygon</p></div></div><div class="odoc-spec"><div class="spec value" id="val-contains" class="anchored"><a href="#val-contains" class="anchor"></a><code><span><span class="keyword">val</span> contains : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="../Point/index.html#type-t">Point.t</a> <span class="arrow">&#45;&gt;</span></span> bool</span></code></div><div class="spec-doc"><p>Returns true if a polygon contains a point. Randolph Franklin code for raycasting</p></div></div><div class="odoc-spec"><div class="spec value" id="val-segments_intersection_points" class="anchored"><a href="#val-segments_intersection_points" class="anchor"></a><code><span><span class="keyword">val</span> segments_intersection_points : 
  <span><span><span><a href="../Point/index.html#type-t">Point.t</a> list</span> <span class="xref-unresolved">Geoml__</span>.Segment.Tbl.t</span> <span class="arrow">&#45;&gt;</span></span>
  <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span>
  <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span>
  <span><a href="../Point/index.html#type-t">Point.t</a> list</span></span></code></div><div class="spec-doc"><p>Get a list of the intersections points of the edges of two polygons</p></div></div><div class="odoc-spec"><div class="spec value" id="val-intersection_polygons" class="anchored"><a href="#val-intersection_polygons" class="anchor"></a><code><span><span class="keyword">val</span> intersection_polygons : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> list</span></span></code></div><div class="spec-doc"><p>Implementation of Weiler Atherton Algorithm for concave/convexe polygons clipping. Complexity is O(m*n).</p></div></div><div class="odoc-spec"><div class="spec value" id="val-triangulation" class="anchored"><a href="#val-triangulation" class="anchor"></a><code><span><span class="keyword">val</span> triangulation : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span><span>(<a href="../Point/index.html#type-t">Point.t</a> * <a href="../Point/index.html#type-t">Point.t</a> * <a href="../Point/index.html#type-t">Point.t</a>)</span> list</span></span></code></div></div><div class="odoc-spec"><div class="spec module" id="module-Convex" class="anchored"><a href="#module-Convex" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Convex/index.html">Convex</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div></div></body></html>