private void DoRotate(IRotation rotation, IMazeViewData mazeView, IReadOnlyDictionary <ILocation, INode> nodesByLocation) { IAxis axis = rotation.GetRotationAxis(mazeView); double angle = DegreesToRadial(rotation.GetAngle()); Matrix <double> rotationMatrix = axis.GetRotationMatrix(angle); DoRotateView(rotationMatrix, mazeView, nodesByLocation); ApplyRotation(mazeView.MovementCube, rotationMatrix); rotation.SetRotationAxisForDirection(mazeView, GetFreeRotationAxis(mazeView)); }