Wednesday 29 July 2015

trigonometry - The ratio of the sides of a triangle gives us the angle of a line?

I'm really trying to understand trigonometry and I am having problem understanding some basic things.




We have
$$\sin(1) = 0.8414709848078965$$



This is basically telling me a ratio. The ratio is of the side that is opposite an angle of 57 degrees (1 radian) to its longest side, the hypotenuse (opp/hyp) so if you convert this into a fraction. I rounded to $0.838$ and I got $\frac{419}{500}$.. So the opposite sides length is $419$ and the terminal side is $500$. $419$ is a prime number, and can't be reduced (I think). I'm having problems figuring out how since we have those lengths we can make the lines of any size we want in canvas.



Maybe I'm not sure I know how ratios works. back to the triangle I know that the adjacent side is $652$. Does that come in to play?



Is the way that we get the proper sized lines at a specific angle done through the unit circle. Is that the only way to do it?




I actually just set out to make a line with an angle of about $57$ degrees and a length of $200$ for an example. While doing it I remembered from trig tutorials to use the cosine for the $x$ value of the unit circle and the sine for the $y$ value. I just accepted that.



The part in the code



context.lineTo(100 + length * fiftySevenX, 100 + length * fiftySevenY);



How do we know to do $\frac{419}{500} * (\text{the length that we want})$ will give us the line that we want? This has to do with the fact that the radius is $1$ in the unit circle and we're scaling it up by $200$ but how are we scaling $\frac{419}{500}$ down ?



  window.onload = function(){
var canvas = document.getElementById("canvas");

var context = canvas.getContext("2d");

var length = 200;

var fiftySevenY = Math.sin(1); // 0.8414709848078965
var fiftySevenX = Math.cos(1) // 0.5403023058681398

context.beginPath()
context.arc(100,100,4,0, 2*Math.PI, false)
context.fill()

context.moveTo(100,100), // start canvas point
context.lineTo(100 + length * fiftySevenX, 100 + length * fiftySevenY);
context.stroke()
context.closePath();
}




No comments:

Post a Comment

real analysis - How to find $lim_{hrightarrow 0}frac{sin(ha)}{h}$

How to find $\lim_{h\rightarrow 0}\frac{\sin(ha)}{h}$ without lhopital rule? I know when I use lhopital I easy get $$ \lim_{h\rightarrow 0}...