How can I convert the following into C++?
sin2x?
Thank you.
As others will usually say, using pow() to square stuff is usually overkill, so you might want to just use sin(x)*sin(x).
Calculating trigonometric function 2 times might be even more overkill.
Assign to variable, multiply it by itself.
True, I was thinking about that myself after I posted but didn't bother saying anything.