cos (40); This mathematical operation cannot be negative because it is in the first quadrant; Please check this in the simulator. Thank you
Cristina