void tformsetangle(Tform *t, real angle) { real c = cosr(angle); real s = sinr(angle); t->col1.x = c; t->col2.x = -s; t->col1.y = s; t->col2.y = c; }
real randn() { static bool prepped = false; static real prepped_result = 0; if (prepped) { prepped = false; return prepped_result; } else { real u1 = randf(), u2 = randf(); real len = sqrtr(-2 * logr(u1)); prepped = true; prepped_result = len * sinr(2*M_PI*u2); return len * cosr(2*M_PI*u2); } }
float cosr(int alpha) { return sinr(alpha + 90); }