Exemple #1
0
        public static QuaternionJson operator +(QuaternionJson v1, QuaternionJson v2)
        {
            QuaternionJson res = new QuaternionJson();

            res.X = v1.X + v2.X;
            res.Y = v1.Y + v2.Y;
            res.Z = v1.Z + v2.Z;
            res.W = v1.Z + v2.W;
            return(res);
        }
Exemple #2
0
        public static QuaternionJson operator /(QuaternionJson v1, float f)
        {
            QuaternionJson res = new QuaternionJson();

            res.X = v1.X / f;
            res.Y = v1.Y / f;
            res.Z = v1.Z / f;
            res.W = v1.W / f;
            return(res);
        }
Exemple #3
0
        public static QuaternionJson Mediate(QuaternionJson v1, QuaternionJson v2)
        {
            QuaternionJson res = new QuaternionJson();

            res.X = (v1.X + v2.X) / 2;
            res.Y = (v1.Y + v2.Y) / 2;
            res.Z = (v1.Z + v2.Z) / 2;
            res.W = (v1.W + v2.W) / 2;
            return(res);
        }
Exemple #4
0
 public static QuaternionJson Mean(List <QuaternionJson> lst)
 {
     if (lst != null && lst.Count > 0)
     {
         QuaternionJson r = new QuaternionJson();
         foreach (var i in lst)
         {
             r += i;
         }
         return(r / lst.Count);
     }
     return(null);
 }