How do you do a sign function?

In summary, there are various methods for calculating the sine function without a calculator, such as using a sine table, using the symmetries of the function, or using Taylor's series. The Taylor's series can be used for both sine and cosine, but they have different general terms. The CORDIC method is commonly used by calculators and computers.
  • #1
box
12
0
I have always used a calculator to find the sin when the angle is given. But how would you figure this out if you didn't have a calculator
 
Mathematics news on Phys.org
  • #2
box said:
I have always used a calculator to find the sin when the angle is given. But how would you figure this out if you didn't have a calculator
Look up in a sine table.
 
  • #3
[tex]\sin x=x-x^3/6+x^5/120-...[/tex]
One can use the symmetries of the function to avoid large values of x (where convergence is slow) and only ever have to calculate with x as large as pi/2. For example, sin(2)=sin(pi-2)=sin(1.14159..). One can even do better by using the expansion of cosine:
[tex]\cos x=1-x^2/2+x^4/24-...[/tex]
Then using sin^2+cos^2=1, you only need the series up to x=pi/4. The series converges very quickly for such small x.
 
  • #4
...and to a limited extent you can calculate them by hand using the angles you already know (30, 45, 60, 90, etc.) with identities such as the double and half-angle formulas.
 
  • #5
You can use the Taylor's series for sin(x)= x- x2/2+ x4/4!- x6/6!+ ... where the general term is (-1)nx2n/(2n)! and a few terms should get you pretty good accuracy.

My understanding is that calculators and computers actually use the "CORDIC" method:
http://www.dspguru.com/info/faqs/cordic.htm
 
  • #6
HallsofIvy said:
You can use the Taylor's series for sin(x)= x- x2/2+ x4/4!- x6/6!+ ... where the general...
There's a slight error there... You just mixed up the Taylor expansion for sin(x), and cos(x) :smile:.
[tex]\sin x = x - \frac{x ^ 3}{3!} + \frac{x ^ 5}{5!} - \frac{x ^ 7}{7!} + ... = \sum_{n = 0} ^ {\infty} \frac{(-1) ^ n}{(2n + 1)!} x ^ {2n + 1}[/tex]
[tex]\cos x = 1 - \frac{x ^ 2}{2!} + \frac{x ^ 4}{4!} - \frac{x ^ 6}{6!} + ... = \sum_{n = 0} ^ {\infty} \frac{(-1) ^ n}{(2n)!} x ^ {2n}[/tex]
Viet Dao,
 
  • #7
Oops!

No wonder I keep getting my trig problems wrong!
 

1. What is the sign function?

The sign function, also known as the signum function, is a mathematical function that returns the sign of a real number. It indicates whether the number is positive, negative, or zero. It is denoted by the symbol "sgn" or "sign".

2. How do you write the sign function in mathematical notation?

The sign function can be written as sgn(x) or sign(x), where x is the input number.

3. How do you calculate the sign of a number?

The sign of a number can be calculated by considering its mathematical properties. A positive number has a sign of +1, a negative number has a sign of -1, and zero has a sign of 0. Therefore, to calculate the sign of a number, you can simply check its value and assign the appropriate sign.

4. What is the purpose of the sign function?

The sign function is primarily used in mathematical and scientific computations to determine the direction of a quantity. It is also used in various fields such as signal processing, physics, and engineering to analyze data and make decisions based on the sign of a value.

5. How do you use the sign function in programming?

In programming, the sign function can be implemented using conditional statements. For example, in Java, you can use the Math.signum() method to return the sign of a number. In Python, you can use the built-in function sign() from the math module. Other programming languages may have similar functions or methods to calculate the sign of a number.

Similar threads

Replies
9
Views
1K
  • General Math
Replies
9
Views
1K
Replies
5
Views
1K
  • General Math
Replies
5
Views
1K
  • General Math
Replies
5
Views
845
Replies
12
Views
2K
Replies
10
Views
213
Back
Top