BEPUutilities.Quaternion.CreateFromAxisAngle C# (CSharp) Method

CreateFromAxisAngle() public static method

Creates a quaternion from an axis and angle.
public static CreateFromAxisAngle ( BEPUutilities.Vector3 axis, float angle ) : Quaternion
axis BEPUutilities.Vector3 Axis of rotation.
angle float Angle to rotate around the axis.
return Quaternion
        public static Quaternion CreateFromAxisAngle(Vector3 axis, float angle)
        {
            float halfAngle = angle * .5f;
            float s = (float)Math.Sin(halfAngle);
            Quaternion q;
            q.X = axis.X * s;
            q.Y = axis.Y * s;
            q.Z = axis.Z * s;
            q.W = (float)Math.Cos(halfAngle);
            return q;
        }

Same methods

Quaternion::CreateFromAxisAngle ( BEPUutilities.Vector3 &axis, float angle, &q ) : void