I'd need more code, but as far as I remember q/sin and q/cos need q/defsketch to run first so they have current_applet available
current_applet