Stan, unit vectors in <span class="math inline">\(K\)</span> dimensions are declared as</p>
<pre><code>unit_vector[K] alpha;</code></pre>
<p>A unit vector has length one (meaning the sum of squared values is
one, not that its number of elements is one).</p>
</div>
<div id="angles-from-unit-vectors" class="section level3 unnumbered">
<h3>Angles from unit vectors</h3>
<p>Angles can be calculated from unit vectors. For example, a random
variable <code>theta</code> representing an angle in <span class="math inl