Trace lines with math functions

Hey, I’m really new, so this is probably a silly question, but I have some code that makes a bitmap follow a sine wave path across the stage…how could i make the code trace the sine wave, leaving a wavy line on the stage?