calculate theta back
in
Programming Questions
•
1 year ago
I want to be able to calculate a angle back,
atm i get this as console output:
a: 3.2608192
b: -3.022366
c: -3.022366
a: 3.2948718
b: -2.9883134
c: -2.9883134
a: 3.3004713
b: -2.982714
c: -2.982714
This is a small piece.
- float n = noise(x*zoomOut + pStep, y*zoomOut + pStep);
- // theta will be between 0 and TWO_PI since noise is never higher then 1
- float theta = TWO_PI * n;
- println("a: "+theta);
- field[x][y].x = cos(theta);
- field[x][y].y = sin(theta);
- println("b: "+atan2(field[x][y].y, field[x][y].x));
- println("c: "+field[x][y].heading2D());
Looking at the difference between a compared to b/c then it can't be float precision i guess since it's a bit extreme for that.
1