src/kalidokit/utils/vector.js
//find 3D rotation of 2 points
find 3D rotation of 2 points
find 3D rotation of 2 points
static findRotation(a, b, normalize = true) {
        if (normalize) {
            return new Vector(
                Vector.normalizeRadians(Vector.find2DAngle(a.z, a.x, b.z, b.x)),
                Vector.normalizeRadians(Vector.find2DAngle(a.z, a.y, b.z, b.y)),
                Vector.normalizeRadians(Vector.find2DAngle(a.x, a.y, b.x, b.y))
            );
        } else {
            return new Vector(
                Vector.find2DAngle(a.z, a.x, b.z, b.x),
                Vector.find2DAngle(a.z, a.y, b.z, b.y),
                Vector.find2DAngle(a.x, a.y, b.x, b.y)
            );
        }
    }
static findRotation ( a , b , normalize = true ) { if ( normalize ) { return new Vector ( Vector . normalizeRadians ( Vector . find2DAngle ( a . z , a . x , b . z , b . x ) ) , Vector . normalizeRadians ( Vector . find2DAngle ( a . z , a . y , b . z , b . y ) ) , Vector . normalizeRadians ( Vector . find2DAngle ( a . x , a . y , b . x , b . y ) ) ) ; } else { return new Vector ( Vector . find2DAngle ( a . z , a . x , b . z , b . x ) , Vector . find2DAngle ( a . z , a . y , b . z , b . y ) , Vector . find2DAngle ( a . x , a . y , b . x , b . y ) ) ; } }
find 3D rotation of 2 points
find 3D rotation of 2 points