Beispiel #1
0
        public static Rotor Exp(Branch b)
        {
            // Compute the rotor angle
            float ang     = _mm_store_ss(Detail.sqrt_nr1(Detail.hi_dp(b.P1, b.P1)));
            float cos_ang = MathF.Cos(ang);
            float sin_ang = MathF.Sin(ang) / ang;

            var p1 = _mm_mul_ps(_mm_set1_ps(sin_ang), b.P1);

            p1 = _mm_add_ps(p1, _mm_set_ps(0f, 0f, 0f, cos_ang));
            return(new Rotor(p1));
        }
Beispiel #2
0
 public float Norm()
 {
     return(_mm_store_ss(Detail.sqrt_nr1(Detail.hi_dp(P0, P0))));
 }
Beispiel #3
0
        public float SquaredNorm()
        {
            __m128 dp = Detail.hi_dp(P1, P1);

            return(_mm_store_ss(dp));
        }
Beispiel #4
0
        public float SquaredIdealNorm()
        {
            var dp = Detail.hi_dp(P2, P2);

            return(_mm_store_ss(dp));
        }