In C, which you are using, sin takes a double as an argument, not a float. Use sinf for floats. In C++, the functions are overloaded, so will work. Refer to your documentation for the functions you use.