Added math.h header for sin function