Example #1
0
 public Quaternion(Direction3 vectorPart, double scalarPart)
 {
     this.x = vectorPart.x;
     this.y = vectorPart.y;
     this.z = vectorPart.z;
     this.w = scalarPart;
 }
Example #2
0
        public static Quaternion CreateFromAxisAngle(Direction3 axis, double angle, AngleUnit inputUnit)
        {
            angle = AngleConvert(angle, inputUnit, AngleUnit.Radians);
            Quaternion quaternion;
            double     num2 = angle * 0.5f;
            double     num  = (double)Math.Sin((double)num2);
            double     num3 = (double)Math.Cos((double)num2);

            quaternion.x = axis.x * num;
            quaternion.y = axis.y * num;
            quaternion.z = axis.z * num;
            quaternion.w = num3;
            return(quaternion);
        }
Example #3
0
 public void Normalize()
 {
     this /= new Direction3(magnitude);
 }
Example #4
0
 public Point3(Direction3 d)
 {
     this.x = d.x;
     this.y = d.y;
     this.z = d.z;
 }