<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Geoml__Triangle (geoml.Geoml__Triangle)</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__Triangle</nav><h1>Module <code>Geoml__Triangle</code></h1><p>Triangles manipulation</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> <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></code></dt><dd><p>the type of triangles</p></dd></dl><dl><dt class="spec value" id="val-tri_map"><a href="#val-tri_map" class="anchor"></a><code><span class="keyword">val</span> tri_map : <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> <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><dd><p>tri_map f t applies function f in turn to all the points of t and stores the results in a new triangle that is returned.</p></dd></dl><dl><dt class="spec value" id="val-tri_exists"><a href="#val-tri_exists" class="anchor"></a><code><span class="keyword">val</span> tri_exists : <span>(<a href="../Geoml/Point/index.html#type-t">Geoml.Point.t</a> <span>&#45;&gt;</span> bool)</span> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> bool</code></dt><dd><p>Higher order utilities over the triangles</p></dd></dl><dl><dt class="spec value" id="val-tri_find"><a href="#val-tri_find" class="anchor"></a><code><span class="keyword">val</span> tri_find : <span>(<a href="../Geoml/Point/index.html#type-t">Geoml.Point.t</a> <span>&#45;&gt;</span> bool)</span> <span>&#45;&gt;</span> <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-tri_forall"><a href="#val-tri_forall" class="anchor"></a><code><span class="keyword">val</span> tri_forall : <span>(<a href="../Geoml/Point/index.html#type-t">Geoml.Point.t</a> <span>&#45;&gt;</span> bool)</span> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> bool</code></dt><dt class="spec value" id="val-tri_iter"><a href="#val-tri_iter" class="anchor"></a><code><span class="keyword">val</span> tri_iter : <span>(<a href="../Geoml/Point/index.html#type-t">Geoml.Point.t</a> <span>&#45;&gt;</span> unit)</span> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> unit</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="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="../Geoml__/Affine/index.html#type-t">Geoml__.Affine.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p>affine transformation of a triangle</p></dd></dl><dl><dt class="spec value" id="val-make"><a href="#val-make" class="anchor"></a><code><span class="keyword">val</span> make : <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> <a href="../Geoml/Point/index.html#type-t">Geoml.Point.t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p>builds a triangle from three different points. raises Invalid_arg if at least two points are equal</p></dd></dl><dl><dt class="spec value" id="val-extr1"><a href="#val-extr1" class="anchor"></a><code><span class="keyword">val</span> extr1 : <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><dd><p>returns a vertice of the triangle. The vertice returned is different than the one returned by extr2 and extr3.</p></dd></dl><dl><dt class="spec value" id="val-extr2"><a href="#val-extr2" class="anchor"></a><code><span class="keyword">val</span> extr2 : <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><dd><p>returns a vertice of the triangle. The vertice returned is different than the one returned by extr1 and extr3.</p></dd></dl><dl><dt class="spec value" id="val-extr3"><a href="#val-extr3" class="anchor"></a><code><span class="keyword">val</span> extr3 : <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><dd><p>returns a vertice of the triangle. The vertice returned is different than the one returned by extr1 and extr2.</p></dd></dl><dl><dt class="spec value" id="val-scale_x"><a href="#val-scale_x" class="anchor"></a><code><span class="keyword">val</span> scale_x : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> float <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-scale_y"><a href="#val-scale_y" class="anchor"></a><code><span class="keyword">val</span> scale_y : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> float <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></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-reflection"><a href="#val-reflection" class="anchor"></a><code><span class="keyword">val</span> reflection : <a href="../Geoml/Point/index.html#type-t">Geoml.Point.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-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>tests if a point is in a triangle</p></dd></dl><dl><dt class="spec value" id="val-rotate"><a href="#val-rotate" class="anchor"></a><code><span class="keyword">val</span> rotate : <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> float <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p>rotation, angle in radian</p></dd></dl><dl><dt class="spec value" id="val-rotate_angle"><a href="#val-rotate_angle" class="anchor"></a><code><span class="keyword">val</span> rotate_angle : <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> float <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dd><p>rotation, angle in degree</p></dd></dl><dl><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-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-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-segments"><a href="#val-segments" class="anchor"></a><code><span class="keyword">val</span> segments : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="../Geoml/Segment/index.html#type-t">Geoml.Segment.t</a> * <a href="../Geoml/Segment/index.html#type-t">Geoml.Segment.t</a> * <a href="../Geoml/Segment/index.html#type-t">Geoml.Segment.t</a></code></dt><dt class="spec value" id="val-intersects"><a href="#val-intersects" class="anchor"></a><code><span class="keyword">val</span> intersects : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> bool</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><dt class="spec value" id="val-is_isoscele"><a href="#val-is_isoscele" class="anchor"></a><code><span class="keyword">val</span> is_isoscele : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> bool</code></dt><dt class="spec value" id="val-is_equilateral"><a href="#val-is_equilateral" class="anchor"></a><code><span class="keyword">val</span> is_equilateral : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> bool</code></dt><dt class="spec value" id="val-is_right"><a href="#val-is_right" class="anchor"></a><code><span class="keyword">val</span> is_right : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> bool</code></dt><dt class="spec value" id="val-points"><a href="#val-points" class="anchor"></a><code><span class="keyword">val</span> points : <a href="index.html#type-t">t</a> <span>&#45;&gt;</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></code></dt><dt class="spec value" id="val-of_points"><a href="#val-of_points" class="anchor"></a><code><span class="keyword">val</span> of_points : <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> <span>&#45;&gt;</span> <a href="index.html#type-t">t</a></code></dt><dt class="spec value" id="val-angles"><a href="#val-angles" class="anchor"></a><code><span class="keyword">val</span> angles : <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> float * float * float</code></dt><dt class="spec value" id="val-centroid"><a href="#val-centroid" class="anchor"></a><code><span class="keyword">val</span> centroid : <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><dd><p>returns the gravity center of a triangle</p></dd></dl><dl><dt class="spec value" id="val-random_point"><a href="#val-random_point" class="anchor"></a><code><span class="keyword">val</span> random_point : Stdlib.Random.State.t <span>&#45;&gt;</span> <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><dd><p>returns a randomly and uniformly chosen point of the triangle</p></dd></dl><dl><dt class="spec value" id="val-print"><a href="#val-print" class="anchor"></a><code><span class="keyword">val</span> print : Stdlib.Format.formatter <span>&#45;&gt;</span> <a href="index.html#type-t">t</a> <span>&#45;&gt;</span> unit</code></dt><dd><p>printer</p></dd></dl></div></body></html>