rot 2d

Rotates a 2d coordinate by an angle theta.
Author: Sputnki
License: BSD
Github: sptnk/math/rot 2d.axo

Inlets

frac32buffer x

frac32buffer y

frac32 angle of rotation (64 = 2pi)

Outlets

frac32buffer x

frac32buffer y

Parameters

frac32.s.map theta

Control Rate
int32_t costheta;
int32_t sintheta;
SINE2TINTERP((inlet_theta + param_theta << 5) + (1 << 30), costheta);
SINE2TINTERP((inlet_theta + param_theta << 5), sintheta);
Audio Rate
outlet_x = ___SMMLA(costheta, inlet_x, ___SMMUL(-sintheta, inlet_y)) << 1;
outlet_y = ___SMMLA(sintheta, inlet_x, ___SMMUL(costheta, inlet_y)) << 1;

Privacy

© 2024 Zrna Research