n> <span class="n">_</span><span class="p">,</span> <span class="n">vh</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">linalg</span><span class="o">.</span><span class="n">svd</span><span class="p">(</span><span class="n">vertices</span> <span class="o">-</span> <span class="n">g</span><span class="p">)</span>

                <span class="c1"># get direction (first column is best fit line,</span>
                <span class="c1"># 3rd column is unitary norm)