spec/helpers/spec-helper.js
function(a, epsilon) {
            if(epsilon == undefined) epsilon = EPSILON;
            let allSignsFlipped = false;
            if (e.length != a.length)
                expected(e, "to have the same length as", a);
                
            for (let i = 0; i < e.length; i++) {
                if (isNaN(e[i]) !== isNaN(a[i]))
                    expected(e, "to be equalish to", a);
                
                if (allSignsFlipped) {
                    if (Math.abs(e[i] - (-a[i])) >= epsilon)
                        expected(e, "to be equalish to", a);
                } else {
                    if (Math.abs(e[i] - a[i]) >= epsilon) {
                        allSignsFlipped = true;
                        i = 0;
                    }
                }
            }
        }
function(a, epsilon) {
            if(epsilon == undefined) epsilon = EPSILON;
            let allSignsFlipped = false;
            if (e.length != a.length)
                expected(e, "to have the same length as", a);
                
            for (let i = 0; i < e.length; i++) {
                if (isNaN(e[i]) !== isNaN(a[i]))
                    expected(e, "to be equalish to", a);
                
                if (allSignsFlipped) {
                    if (Math.abs(e[i] - (-a[i])) >= epsilon)
                        expected(e, "to be equalish to", a);
                } else {
                    if (Math.abs(e[i] - a[i]) >= epsilon) {
                        allSignsFlipped = true;
                        i = 0;
                    }
                }
            }
        }
function ( a , epsilon ) { if ( epsilon == undefined ) epsilon = EPSILON ; let allSignsFlipped = false ; if ( e . length != a . length ) expected ( e , "to have the same length as" , a ) ; for ( let i = 0 ; i < e . length ; i ++ ) { if ( isNaN ( e [ i ] ) !== isNaN ( a [ i ] ) ) expected ( e , "to be equalish to" , a ) ; if ( allSignsFlipped ) { if ( Math . abs ( e [ i ] - ( - a [ i ] ) ) >= epsilon ) expected ( e , "to be equalish to" , a ) ; } else { if ( Math . abs ( e [ i ] - a [ i ] ) >= epsilon ) { allSignsFlipped = true ; i = 0 ; } } } }
Dual quaternions are very special & unique snowflakes
Dual quaternions are very special & unique snowflakes