Revit.SDK.Samples.SlabShapeEditing.CS.Matrix4.RotateZ C# (CSharp) Method

RotateZ() public static method

get a matrix used to rotate object specific angle on Z direction
public static RotateZ ( double angle ) : Matrix4
angle double rotate angle
return Matrix4
        public static Matrix4 RotateZ(double angle)
        {
            Matrix4 rotateX = new Matrix4();
            rotateX.Type = MatrixType.Rotation;
            rotateX.Identity();
            double sin = (double)Math.Sin(angle);
            double cos = (double)Math.Cos(angle);
            rotateX.Matrix[1, 1] = cos;
            rotateX.Matrix[1, 2] = sin;

            rotateX.Matrix[2, 1] = -sin;
            rotateX.Matrix[2, 2] = cos;
            return rotateX;
        }