Identity sin(A+B)=sin(A)cos(B)+sin(B)cos(A)

Started by
15 comments, last by curlious 20 years, 6 months ago
quote:Original post by alnite
Thank God, I am not you.


I guess you don''t plan on taking calculus.


[My site|SGI STL|Bjarne FAQ|C++ FAQ Lite|MSDN|Jargon]
Ripped off from various people
[size=2]
Advertisement
I am in Pre-Cal right now so I guess that is why my dad made me memorize all those equations. Nice to know though.
quote:
2sin(A)cos(A) = cos(A)
2sin(A) = 1
sin(A) = 0.5

and thus solve for A.


But you missed a solution, when cos(A) = 0... You should be wary of dividing with variable expressions when they can equal 0. Here is a better way of solving the equation:

2sin(a)cos(a) = cos(a)
2sin(a)cos(a) - cos(a) = 0
cos(a)(2sin(a) - 1)) = 0

So either cos(a) = 0 or (2sin(a) - 1) = 0.
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
Using a vector to rotate another vector without storing an angle, thus bypassing using sin and cos as much as possible? (sort of like a matrix, except just for rotation and scaling)

a.x = cos(angle)
a.y = sin(angle)

b = vector2(...);

c.x = a.x*b.x-a.y*b.y; // cos(a+b) = cos(a)cos(b)-sin(a)sin(b)
c.y = a.y*b.x+b.y*a.x; // sin(a+b) = sin(a)cos(b)+sin(b)cos(a)


(I think I messed up the cos(a+b) one, but the idea is the same)
I used it several times for physics problems. If you have two sound waves of close frequencies and you add them, you get a new wave with some special properties (modulation,..). This happens with light too and diffraction/interference stuff.
quote:Original post by Muzzafarath
quote:
2sin(A)cos(A) = cos(A)
2sin(A) = 1
sin(A) = 0.5

and thus solve for A.


But you missed a solution, when cos(A) = 0... You should be wary of dividing with variable expressions when they can equal 0. Here is a better way of solving the equation:

2sin(a)cos(a) = cos(a)
2sin(a)cos(a) - cos(a) = 0
cos(a)(2sin(a) - 1)) = 0

So either cos(a) = 0 or (2sin(a) - 1) = 0.


Hey, I never said I was *good* at using it that way.

Richard "Superpig" Fine
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.
Enginuity1 | Enginuity2 | Enginuity3 | Enginuity4
ry. .ibu cy. .y''ybu. .abu ry. dy. "sy. .ubu py. .ebu ry. py. .ibu gy." fy. .ibu ny. .ebu
OpenGL is a language

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

It''s like solving for the roots of a polynomial equation.

This topic is closed to new replies.

Advertisement