rot 2d k

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

Inlets

frac32 x

frac32 y

frac32 angle of rotation (64 = 2pi)

Outlets

frac32 x

frac32 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);

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