Hello,
It is well known that the linear combination, or harmonic addition, of sine and cosine waves is equivalent to a single sine (or cosine) wave with a phase shift and scaled amplitude.
I did some online search and found: http://mathworld.wolfram.com/notebooks/Trigonometry/HarmonicAdditionTheorem.nb
Basically the two identities I want to implement as functions are:
a cos(q)+b sin(q)==Sqrt[a^2+b^2] sgn(a) cos(tan^-1(-(b/a))+q)
a cos(q)+b sin(q)==-Sqrt[a^2+b^2] sgn(a) sin(tan^-1(-(b/a))+q-[Pi]/2)
I used mathematica to verify them (see attached notebook).
I need two functions (one for each identity) that would convert the sum of sine and cos wave to either a single sine or cos wave with a phase shift and scaled amplitude.
I am a Mathematica newbie and any help with the syntax would be much appreciated.
Thanks,
Attachments: