I'm working on building tetris now in Java and am at the point of rotations...

I originally hardcoded all of the rotations, but found that linear algebra was the better way to go.

I'm trying to use a rotation matrix to rotate my pieces, and found I need a good understanding of trigonometry.

That being said, the way I visualize sin and cos is on the bottom part of the picture... a circle drawn on a graph... but images online show the sin cos relationship as the above picture... two waves that are "90 degrees" away from each other...

enter image description here

So, my questions are:

1) I can't seem to visualize how they are 90 degree apart. I can't see how those angles are formed in the above graph from sin and cos.

2) It's said that the relationship is Sin X = Cos (90 - x), and that sin is opposite/hypotenuse and cos = adjacent/hypotenuse... but what exactly does that mean? What do the quotients of these mean in relation to an angle? Let's say x = 45 degrees, adjacent = 5 inches, hypotenuse = 5 inches, and opposite = 4 inches... so sin would be 5"/9" = .55 inches... What does this .55 inches mean in relation to the angle? How is it helpful?

Thank you!!

  • $\begingroup$ Damn trig101. Did you try wiki of Khan academy? $\endgroup$ – Koba Apr 15 '13 at 19:28
  • $\begingroup$ @GitGud lol I forgot about the pythagorean theorem... $\endgroup$ – Growler Apr 15 '13 at 19:45
  • $\begingroup$ @Growler I'm sure most people here would like to help you but can't due to the high need of visual aid, at least that's what's keeping me from posting somethings which might be helpful. How do you make these drawings? $\endgroup$ – Git Gud Apr 15 '13 at 19:47
  • $\begingroup$ @GitGud The top graph was copied from online... the bottom one was drawn in MS Paint. I guess if you could just explain the last part of my question What does this .55 inches mean in relation to the angle? How is it helpful?... You don't need to draw anything I suppose. Btw, I fixed the angle lengths above to fit pythagorean theorem $\endgroup$ – Growler Apr 15 '13 at 19:50
  • $\begingroup$ @GitGud given the above lengths... sin = o/h (3/5), cos = a/h (4/5), tan = o/a (3/4)... so sin is the angle of 3/5? Doesn't an angle have to be in degrees? does that mean that sin = 3/5 degrees? That's what I'm struggling with $\endgroup$ – Growler Apr 15 '13 at 19:59

In your $345$ triangle, you have $\sin x = \frac 35$ and $\cos x = \frac 45$. This gives $x \approx 36.87^\circ$. Can you see where the first two come from the diagram? The $90^\circ$ offset between sine and cosine comes from the fact that we measure horizontally for the cosine and vertically for the sine. While it is true that $\sin x = \cos (90^\circ -x)$ the $90^\circ$ offset is better expressed $\sin x = \cos x - 90^\circ$. This version has $x$ increasing in the same direction on both sides of the equation.

2) opposite is the side opposite the angle. In your diagram, the $3$ side is opposite angle $x$, the $4$ side is adjacent, and $5$ is the hypotenuse. As I said, this gives $\sin x=\frac 35 = 0.6$ It has no units. The $3$ and $5$ have units of length (say, inches) but when you divide them the quotient has no units. The trig functions result in unitless numbers. The $0.6$ gives you one way to construct the angle, though the fact that $\tan x = \frac 34$ is easier to see. You start going east $4$ units, then north $3$ units, and you have constructed the angle.

  • $\begingroup$ Nice answer! I'm still confused how you're getting x from those... I looked online and they said that that you can rearrange sin(x) = a into x = sin^-1(a) to get the angle? Why would getting the -1 power of sin get you the angle in degrees? $\endgroup$ – Growler Apr 15 '13 at 20:35
  • $\begingroup$ And... You said that cosine is measured horizontally and sine is measured vertically - so in this gif http://www.butlercc.edu/mathematics/math_courses/ma140/SineCosine.gif... sin would be the waves going upward and cosine would be the waves going to the right? $\endgroup$ – Growler Apr 15 '13 at 20:42
  • $\begingroup$ @Growler: $\sin^{-1} x$ is not $\frac 1{\sin x}$ but the angle whose sine is $x$. It is also called $\arcsin x$ It can be confusing notation. To get $x \approx 36.87^\circ$ I used my calculator. $\endgroup$ – Ross Millikan Apr 15 '13 at 20:42
  • $\begingroup$ @Growler: regarding the .gif, no, you have it backwards. Note that the wave going upward shows the horizontal position of the green dot, so that is the cosine wave. The wave going left shows the vertical position of the green dot, so that is the sine wave. 0 degrees is rightward, and cosine 0=1. When the red segment is pointing right, the upward wave is at the extreme right end of its travel. $\endgroup$ – Ross Millikan Apr 15 '13 at 20:45
  • $\begingroup$ Okay, thanks for all of your help! Never thought I'd end up finding trig useful in my life haha. Once I understand this I may come back with questions on Rotation Matrices (en.wikipedia.org/wiki/Rotation_matrix) $\endgroup$ – Growler Apr 15 '13 at 20:47

You have a lot of errors that need to be corrected (which may be the source of your confusion) -- but to address the specific question you asked, consider taking your diagram with the circle and rotating the whole thing 90 degrees and see how the expressions of $sin x$ and $cos x$ compare in the two pictures. Also consider a reflection of your diagram with the circle. (e.g. across the line $y=x$)

  • $\begingroup$ If you're referring to the errors in the sides not fitting the pythagorean theorem, I've corrected those. Which other errors did you see? $\endgroup$ – Growler Apr 15 '13 at 20:50
  • $\begingroup$ @Growler: Honestly, nearly every numerical calculation is wrong. e.g. in the picture with the circle, the angle is not 45 degrees, and $\sin x = 3/5$ and $\cos x = 4/5$. Later when you list the sides of a 45-degree right triangle, the side lengths you list aren't those of a right triangle, and your expression for $\sin$ doesn't agree with the side lengths you did list. $\endgroup$ – user14972 Apr 15 '13 at 21:04
  • $\begingroup$ okay I was just throwing random numbers up there for pictoral concept sake- wasn't actually checking the validity of the numbers. But I guess that's always good to do $\endgroup$ – Growler Apr 15 '13 at 22:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.