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