<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Circle (geoml.Geoml.Circle)</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; Circle</nav><header class="odoc-preamble"><h1>Module <code><span>Geoml.Circle</span></code></h1><p>Circle manipulation</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><span>{</span></code><table><tr id="type-t.center" class="anchored"><td class="def record field"><a href="#type-t.center" class="anchor"></a><code><span>center : <a href="../Point/index.html#type-t">Point.t</a>;</span></code></td></tr><tr id="type-t.radius" class="anchored"><td class="def record field"><a href="#type-t.radius" class="anchor"></a><code><span>radius : float;</span></code></td></tr></table><code><span>}</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><a href="../Point/index.html#type-t">Point.t</a> <span class="arrow">&#45;&gt;</span></span> <span>float <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-center" class="anchored"><a href="#val-center" class="anchor"></a><code><span><span class="keyword">val</span> center : <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-radius" class="anchored"><a href="#val-radius" class="anchor"></a><code><span><span class="keyword">val</span> radius : <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-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-reflection" class="anchored"><a href="#val-reflection" class="anchor"></a><code><span><span class="keyword">val</span> reflection : <span><a href="../Point/index.html#type-t">Point.t</a> <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-rotate" class="anchored"><a href="#val-rotate" class="anchor"></a><code><span><span class="keyword">val</span> rotate : <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> <span>float <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>radian rotation. <code>rotate c p f</code> returns the rotated circle of <code>c</code> with <code>p</code> as rotation center and <code>f</code> a angle in radian</p></div></div><div class="odoc-spec"><div class="spec value" id="val-rotate_angle" class="anchored"><a href="#val-rotate_angle" class="anchor"></a><code><span><span class="keyword">val</span> rotate_angle : <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> <span>float <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Same as rotate but the angle is given in degree</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><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-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-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-tangent" class="anchored"><a href="#val-tangent" class="anchor"></a><code><span><span class="keyword">val</span> tangent : <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> <a href="../Line/index.html#type-t">Line.t</a></span></code></div><div class="spec-doc"><p>tangent c p returns the tangent of circle c going through point p. p must lie on c's boundary, otherwise behaviour is unspecified</p></div></div><div class="odoc-spec"><div class="spec value" id="val-intersects" class="anchored"><a href="#val-intersects" class="anchor"></a><code><span><span class="keyword">val</span> intersects : <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> bool</span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-intersection" class="anchored"><a href="#val-intersection" class="anchor"></a><code><span><span class="keyword">val</span> intersection : <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>returns the list of intersection points of two circle. It can be:</p><ul><li> when the circles dont intersect</li><li><code>p</code> when the circles are tangent in p</li><li><code>a;b</code> when the circles intersect, a and b are the intersection points</li></ul></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>same as intersection but with a circle and a line</p></div></div><div class="odoc-spec"><div class="spec value" id="val-segment_intersection" class="anchored"><a href="#val-segment_intersection" class="anchor"></a><code><span><span class="keyword">val</span> segment_intersection : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="../Segment/index.html#type-t">Segment.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>same as intersection but with a circle and a segment</p></div></div><div class="odoc-spec"><div class="spec value" id="val-circumscribed" class="anchored"><a href="#val-circumscribed" class="anchor"></a><code><span><span class="keyword">val</span> circumscribed : <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><a href="../Point/index.html#type-t">Point.t</a> <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>returns the circumscribed cirle of the triangle defined by the three points</p></div></div><div class="odoc-spec"><div class="spec value" id="val-incircle" class="anchored"><a href="#val-incircle" class="anchor"></a><code><span><span class="keyword">val</span> incircle : <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><a href="../Point/index.html#type-t">Point.t</a> <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>returns the incirle of the triangle defined by the three points</p></div></div><div class="odoc-spec"><div class="spec value" id="val-of_diameter" class="anchored"><a href="#val-of_diameter" class="anchor"></a><code><span><span class="keyword">val</span> of_diameter : <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> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>of_diameter a b builds the circle with ab as diameter</p></div></div><div class="odoc-spec"><div class="spec value" id="val-bounding" class="anchored"><a href="#val-bounding" class="anchor"></a><code><span><span class="keyword">val</span> bounding : <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 class="spec-doc"><p>given a list of point, returns the smallest circle that contains all the points of the list, using emo welzl's algorithm. complexity in expected linear time</p></div></div><div class="odoc-spec"><div class="spec value" id="val-random_point" class="anchored"><a href="#val-random_point" class="anchor"></a><code><span><span class="keyword">val</span> random_point : <span><span class="xref-unresolved">Stdlib</span>.Random.State.t <span class="arrow">&#45;&gt;</span></span> <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 class="spec-doc"><p>returns a randomly and uniformly chosen point that lies inside the circle</p></div></div><div class="odoc-spec"><div class="spec value" id="val-random_point_perimeter" class="anchored"><a href="#val-random_point_perimeter" class="anchor"></a><code><span><span class="keyword">val</span> random_point_perimeter : <span><span class="xref-unresolved">Stdlib</span>.Random.State.t <span class="arrow">&#45;&gt;</span></span> <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 class="spec-doc"><p>returns a randomly and uniformly chosen point that lies on the permieter of the circle</p></div></div><div class="odoc-spec"><div class="spec value" id="val-print" class="anchored"><a href="#val-print" class="anchor"></a><code><span><span class="keyword">val</span> print : <span><span class="xref-unresolved">Stdlib</span>.Format.formatter <span class="arrow">&#45;&gt;</span></span> <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>printer</p></div></div></div></body></html>