benfry / processing4

Processing 4.x releases for Java 17
https://processing.org
Other
1.35k stars 237 forks source link

Cosine Function is wrong #790

Closed JulioJrCepeda closed 1 year ago

JulioJrCepeda commented 1 year ago
## Description The cos() functions sometimes outputs a number outside the expected range.

Expected Behavior

The cos() function should output a number between -1 and 1.

Current Behavior

when I give it PI/2 is outputs -4. ## Steps to Reproduce
  1. Put this line of code on project print(cos(PI/2));
  2. Run it. It outputs a number smaller than -1.

Your Environment

Possible Causes / Solutions

JulioJrCepeda commented 1 year ago

I was wrong