Esempio n. 1
0
        public void ToAngleAxis(out Radian rfAngle, out Vector3 rkAxis)
        {
            rkAxis = Vector3.ZERO;
            float fValue = (float)((this.x * this.x) + (this.y * this.y) + (this.z * this.z));

            if (fValue > 0.0)
            {
                Radian radian = (Radian)((float)(2.0 * System.Math.Acos(this.w)));
                rfAngle = radian;
                float num = Math.InvSqrt(fValue);
                rkAxis.x = this.x * num;
                rkAxis.y = this.y * num;
                rkAxis.z = this.z * num;
            }
            else
            {
                Radian radian = new Radian(0.0f);
                rfAngle  = radian;
                rkAxis.x = 1f;
                rkAxis.y = 0.0f;
                rkAxis.z = 0.0f;
            }
        }