<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Vector (geoml.Geoml.Vector)</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; Vector</nav><header class="odoc-preamble"><h1>Module <code><span>Geoml.Vector</span></code></h1></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.dx" class="anchored"><td class="def record field"><a href="#type-t.dx" class="anchor"></a><code><span>dx : float;</span></code></td></tr><tr id="type-t.dy" class="anchored"><td class="def record field"><a href="#type-t.dy" class="anchor"></a><code><span>dy : float;</span></code></td></tr></table><code><span>}</span></code></div><div class="spec-doc"><p>The module for the euclidean vector manipulation.</p></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>float <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-null" class="anchored"><a href="#val-null" class="anchor"></a><code><span><span class="keyword">val</span> null : <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>null vector</p></div></div><div class="odoc-spec"><div class="spec value" id="val-x_coord" class="anchored"><a href="#val-x_coord" class="anchor"></a><code><span><span class="keyword">val</span> x_coord : <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-y_coord" class="anchored"><a href="#val-y_coord" class="anchor"></a><code><span><span class="keyword">val</span> y_coord : <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-of_points" class="anchored"><a href="#val-of_points" class="anchor"></a><code><span><span class="keyword">val</span> of_points : <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_points a b returns the vector begining at a and landing at b</p></div></div><div class="odoc-spec"><div class="spec value" id="val-magnitude" class="anchored"><a href="#val-magnitude" class="anchor"></a><code><span><span class="keyword">val</span> magnitude : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> float</span></code></div><div class="spec-doc"><p>returns the norm of a vector</p></div></div><div class="odoc-spec"><div class="spec value" id="val-magnitude_sq" class="anchored"><a href="#val-magnitude_sq" class="anchor"></a><code><span><span class="keyword">val</span> magnitude_sq : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> float</span></code></div><div class="spec-doc"><p>returns the square of the norm of a vector</p></div></div><div class="odoc-spec"><div class="spec value" id="val-normalize" class="anchored"><a href="#val-normalize" class="anchor"></a><code><span><span class="keyword">val</span> normalize : <span><a href="#type-t">t</a> <span class="arrow">&#45;&gt;</span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>return a vector with same direction but with a norm equal to 1.</p></div></div><div class="odoc-spec"><div class="spec value" id="val-rotation" class="anchored"><a href="#val-rotation" class="anchor"></a><code><span><span class="keyword">val</span> rotation : <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-dot_product" class="anchored"><a href="#val-dot_product" class="anchor"></a><code><span><span class="keyword">val</span> dot_product : <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> float</span></code></div><div class="spec-doc"><p>dot product of two vectors</p></div></div><div class="odoc-spec"><div class="spec value" id="val-scal_mult" class="anchored"><a href="#val-scal_mult" class="anchor"></a><code><span><span class="keyword">val</span> scal_mult : <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 class="spec-doc"><p>scalar product of two vectors</p></div></div><div class="odoc-spec"><div class="spec value" id="val-determinant" class="anchored"><a href="#val-determinant" class="anchor"></a><code><span><span class="keyword">val</span> determinant : <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> float</span></code></div></div><div class="odoc-spec"><div class="spec value" id="val-opposite" class="anchored"><a href="#val-opposite" class="anchor"></a><code><span><span class="keyword">val</span> opposite : <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-add" class="anchored"><a href="#val-add" class="anchor"></a><code><span><span class="keyword">val</span> add : <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> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>vector addition</p></div></div><div class="odoc-spec"><div class="spec value" id="val-substract" class="anchored"><a href="#val-substract" class="anchor"></a><code><span><span class="keyword">val</span> substract : <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> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>vector substraction</p></div></div><div class="odoc-spec"><div class="spec value" id="val-move_to" class="anchored"><a href="#val-move_to" class="anchor"></a><code><span><span class="keyword">val</span> move_to : <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="../Point/index.html#type-t">Point.t</a></span></code></div><div class="spec-doc"><p>move_to v p returns the translation of p according to the vector v</p></div></div><div class="odoc-spec"><div class="spec value" id="val-projection" class="anchored"><a href="#val-projection" class="anchor"></a><code><span><span class="keyword">val</span> projection : <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> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>projection v1 v2 returns the projection of v1 on v2</p></div></div><div class="odoc-spec"><div class="spec value" id="val-angle" class="anchored"><a href="#val-angle" class="anchor"></a><code><span><span class="keyword">val</span> angle : <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> float</span></code></div><div class="spec-doc"><p>returns the angle between two vectors</p></div></div><div class="odoc-spec"><div class="spec value" id="val-angle_deg" class="anchored"><a href="#val-angle_deg" class="anchor"></a><code><span><span class="keyword">val</span> angle_deg : <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> float</span></code></div><div class="spec-doc"><p>compute the angle in radians</p><p>compute the angle in degrees</p></div></div><div class="odoc-spec"><div class="spec value" id="val-reflect" class="anchored"><a href="#val-reflect" class="anchor"></a><code><span><span class="keyword">val</span> reflect : <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> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>reflect a b returns the reflected vector of a according to b</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></div></body></html>