NewTOAPIA.float3x3.Rotate C# (CSharp) Method

Rotate() public static method

Rotation by angle theta about unit axis u
public static Rotate ( float theta, float3 u ) : float3x3
theta float
u float3
return float3x3
        public static float3x3 Rotate(float theta, float3 u)
        {
            if (theta == 0f) return Identity;

            float3 w = new float3(theta * u.x, theta * u.y, theta * u.z);

            float3x3 wx = w.CRS;

            return Identity + (((float)Math.Sin(theta)) / theta) * wx + ((1 - ((float)Math.Cos(theta))) / (theta * theta)) * (wx * wx);
        }