How to efficiently calculate cotangents from vectors <p>I'm trying to implement a function to compute the cotangents of vectors (the mathematical ones) via the standard formula:</p> <blockquote> <p>cot(<strong>a</strong>, <strong>b</strong>) = (<strong>a</strong> * <strong>b</strong>) / |<strong>a</strong> x <strong>b</strong>|, where <strong>a</strong> and <strong>b</strong> are vectors</p> </blockquote> <p>A colleague told me that calculating <code>1/|a x b|</code> is not the best thing to give a computer to calculate. Another alternative coming to my head is first calculating the angle and than using cotan functions for radians angles.</p> <p>What would be the method of choice here? (Is there maybe another one, other than the mentioned ones)</p>