use sinf and cosf here to avoid the unnecessary casts