How is sin 135 calculated on a calculator?!?

364 Views Asked by At

When I type in sin(45) into a calculator I get the value 0.707. When I type in sin(135) into a calculator I also get 0.707. What is the procedure that creates the same value in both cases? Is it some if, then function? ie if x>90 minus 90 sort of thing?? I hope I am clear with what I am asking. Any insight would be greatly appreciated. Many thanks.

3

There are 3 best solutions below

0
On

Calculators use built-in algorithms to compute this kind of functions. These can be pretty sophisticated, and the quadrant discussion is probably the easiest part.

The first step in the computation is to divide the argument by a quarter turn (whatever the angular unit). Then you take the modulo $4$ of the integer part, and obtain a number normalized to the range $[0,4)$; think that the argument could as well be $1000000°$ or $-2345.33$ radians.

The integer part tells you the quadrant and which symmetry rules you can apply. In the end, all angles can be reduced to the first quadrant.

From this, the sine/cosine can be evaluated by means of predefined polynomials, or by the smart CORDIC method.

0
On

The sine satisfies the following relations: $$ \sin(180 - A)=\sin A,\ \ \ \sin(180+A)=-\sin A. $$ Similarly, the cosine satisfies $$ \cos(180-A)=-\cos A,\ \ \ \cos(180+A)=-\cos A $$ With those you can always reduce to calculating the sine and cosine of angles in the first quadrant. When you get to the actual calculation in the first quadrant, this answer gives some details.

0
On

sin calculates the value of the sine function. The basic symmetries of this function are

  • $\sin(-x)=-\sin(x)$
  • $\sin(x+180) = -\sin(x)$ (for a $x$ in degrees).

Thus $ \sin(135) = -\sin(-45) = \sin(45)$.