Add atan2, which was conspicuously absent, to the VM

- DECORATE now has atan2(y,x) and VectorAngle(x,y) functions. They are
  identical except for the order of their parameters. The returned angle
  is in degrees (not radians).
This commit is contained in:
Randy Heit 2016-04-18 23:06:17 -05:00
commit e83bc53678
6 changed files with 135 additions and 0 deletions

View file

@ -1039,6 +1039,11 @@ begin:
reg.f[a] = reg.f[B] > konstf[C] ? reg.f[B] : konstf[C];
NEXTOP;
OP(ATAN2):
ASSERTF(a); ASSERTF(B); ASSERTF(C);
reg.f[a] = g_atan2(reg.f[B], reg.f[C]) * (180 / M_PI);
NEXTOP;
OP(FLOP):
ASSERTF(a); ASSERTF(B);
fb = reg.f[B];