コード例 #1
0
        public static __v4t__ Transform(this __type__ rot, __v4t__ v)
        {
            __ftype__ a = Fun.Cos(rot.Angle);
            __ftype__ b = Fun.Sin(rot.Angle);

            return(new __v4t__(a * v.X + -b * v.Y,
                               b * v.X + a * v.Y,
                               v.Z, v.W));
        }
コード例 #2
0
        public static __v4t__ Multiply(__rot2t__ rot, __v4t__ vec)
        {
            __ft__ a = (__ft__)System.Math.Cos(rot.Angle);
            __ft__ b = (__ft__)System.Math.Sin(rot.Angle);

            return(new __v4t__(a * vec.X +
                               b * vec.Y,

                               -b * vec.X +
                               a * vec.Y,

                               vec.Z,

                               vec.W));
        }
コード例 #3
0
 public __type__(__v4t__ v)
 {
     W = v.X;
     X = v.Y; Y = v.Z; Z = v.W;
 }
コード例 #4
0
 public static __v4t__ InvTransform(this __type__ rot, __v4t__ v)
 => Transform(rot.Inverse, v);