src/third_party/specimenTools/lib/bower_components/Atem-Math-Tools/lib/hobby.js
/**
     * dir0 and dir1 are radians
     * alpha, beta are the magnitudes
     *
     * Also
     * [Infinity, Infinity] instead of [NaN, NaN] when the magnitudes are 0
     * And it can still return a tension for one control when the other
     * control is 0
     */
dir0 and dir1 are radians
alpha, beta are the magnitudes

Also
[Infinity, Infinity] instead of [NaN, NaN] when the magnitudes are 0
And it can still return a tension for one control when the other
control is 0
dir0 and dir1 are radians alpha beta are the magnitudes Also [ Infinity Infinity ] instead of [ NaN NaN ] when the magnitudes are 0 And it can still return a tension for one control when the other control is 0
function _magnitude2tension(z0, dir0, alpha, beta, dir1, z1) {
        var uv, u, v
          , _alpha = alpha === 0 || alpha === undefined ? undefined : 1
          , _beta = beta === 0 || beta === undefined ? undefined : 1
          ;
        if(_alpha || _beta)
            uv = _tension2control(z0, dir0, _alpha, _beta, dir1, z1);
        if(alpha === 0)
            u = Infinity;
        else if (alpha !== undefined)
            u = uv[0]['-'](z0).magnitude()/alpha;
        if(beta === 0)
            v = Infinity;
        else if (beta !== undefined)
            v = uv[1]['-'](z1).magnitude()/beta;
        return[u, v];
    }
function _magnitude2tension ( z0 , dir0 , alpha , beta , dir1 , z1 ) { var uv , u , v , _alpha = alpha === 0 || alpha === undefined ? undefined : 1 , _beta = beta === 0 || beta === undefined ? undefined : 1 ; if ( _alpha || _beta ) uv = _tension2control ( z0 , dir0 , _alpha , _beta , dir1 , z1 ) ; if ( alpha === 0 ) u = Infinity ; else if ( alpha !== undefined ) u = uv [ 0 ] [ '-' ] ( z0 ) . magnitude ( ) / alpha ; if ( beta === 0 ) v = Infinity ; else if ( beta !== undefined ) v = uv [ 1 ] [ '-' ] ( z1 ) . magnitude ( ) / beta ; return [ u , v ] ; }
dir0 and dir1 are radians
 alpha, beta are the magnitudes
dir0 and dir1 are radians alpha beta are the magnitudes
// 1 is the default tension