function [time_array]=sin_to_delay(mag,wn)
%sin_to_delay allows you to input the parameters for a sign wave, and get
% out the delay times that represent a sine way to the PIC
%mag is the magnitude of the distance traveled (mm)
%wn is the frequency of the sin curve. It is in rad/s
%time_array is a signed output of delay times. The magnitude represents
% the direction, while the magnitude represents the magnitude of delay in
% us
time_array=fun_to_delay(@(x)(-mag/2*cos(wn*x)));