d chord entry
        and exit points on the surface of a sphere.
      </p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">cos_theta</span> <span class="special">=</span> <span class="number">1</span> <span class="special">-</span> <span class="number">2</span> <span class="special">*</span> <span class="identifier">dist</span><span class="special">(</span><span class="identifier">gen</span><span class="special">);</span>
<span class="keyword">double</span