Trig

Want to just shoot the breeze? Forum 42 is the place!

Moderator:Moderators

Post Reply
JackFrost22
Sir Posts-alot
Posts:4186
Joined:Fri Jun 04, 2004 4:10 pm
Trig

Post by JackFrost22 » Fri Mar 17, 2006 12:49 pm

Is it possible to.., wait of course its possible. How do you calulate Sin, ArcSin, Cos, ArcCos and Tan, ArcTan without tables or a calculator?

User avatar
marshallh
Moderator
Posts:2986
Joined:Sat Sep 10, 2005 2:17 pm
360 GamerTag:marshallh
Location:here and there
Contact:

Post by marshallh » Fri Mar 17, 2006 1:12 pm

By using a certain algorithm. That's what they use to make the tables od olde.

This website explains how calculators get these answers
http://www.hpmuseum.org/journals/9100iprg.htm
Circular Routines
The circular routines (sin, cos, tan), the inverse circular routines (arcsin, arccos, arctan) and the polar to rectangular and rectangular to polar conversions are all accomplished by iterating through a transformation which rotates the axes. Any angle may be represented as an angle between 0 and 1 radian plus additional information such as the number of times pi/2 has been added or subtracted, and its sign. The basic algorithm for the forward circular function operates on an angle whose absolute value is less than 1 radian, but prescaling is necessary to indicate quadrant.

To obtain the scaling constants, the argument is divided by 2, the integer part discarded and the remaining fraction of the circle multiplied by 2. Then pi/2 is subtracted from the absolute value until the angle is less than 1 radian. The number of times pi/2 is subtracted, the original sign of the argument, and the sign upon completion of the last subtraction make up the scaling constants. To preserve the quadrant information the scaling constants are stored in the core memory.

The algorithm produces tan. Therefore, in the Model 9100A, cos is generated as 1/sqrt(1 + tan2) and sin as tan/sqrt(1 + tan2)

Sin could be obtained from the relationship sin = sqrt(1-cos2) for example, but the use of the tangent relationship preserves the 12 digit accuracy for very small angles, even in the range of < 10-12. The proper signs of the functions are assigned from the scaling constants.

For the polar to rectangular functions, cos and sin are computed and multiplied by the radius vector to obtain the X and Y coordinates. In performing the rectangular to polar function, the signs of both the X and Y vectors are retained to place the resulting angle in the right quadrant.

Prescaling must also precede the inverse circular functions, since this routine operates on arguments less than or equal to 1. The inverse circular algorithm yields arctangent functions, making it necessary to use the trigonometric identity. sin-1(x) = tan-1(x/sqrt(1 - x2)).

If a cos-1(x) is desired, the arcsin relationship is used and a scaling constant adds pi/2 after completion of the function. For arguments greater than 1, the arccotangent of the negative reciprocal is found which yields the arctangent when pi/2 is added.
Image

User avatar
timmeh87
Senior Member
Posts:3047
Joined:Mon Nov 14, 2005 10:19 pm
Location:Ontario, Canada

Post by timmeh87 » Fri Mar 17, 2006 3:20 pm

you can approximate sine with the maclauren series

Image

its a sum from n=0 to infinity, so it might take a while to calculate. ;) i just wrote a test on this stuff. not. fun.

cosine has a similar series, and you can get tan by dividing them. oh, and just to screw with you, X is in radians.

-----

basically there is no real way to do it thas both easy and 100% accurate
Image

"Linux is only free if your time is worthless"

JackFrost22
Sir Posts-alot
Posts:4186
Joined:Fri Jun 04, 2004 4:10 pm

Post by JackFrost22 » Fri Mar 17, 2006 4:39 pm

thanks

User avatar
Mr. Hawkins
Posts:61
Joined:Sat Nov 12, 2005 7:32 pm
Location:Way down South

Post by Mr. Hawkins » Fri Mar 17, 2006 7:59 pm

DEATH TO TRIG :evil: :evil: :evil: . Just finished it in math this week :D . Good riddance.
It's not about quantity, but rather quality
Image
Image

User avatar
gamer2
Senior Member
Posts:3611
Joined:Tue Jul 27, 2004 12:38 pm
Location:You spam, SANTA Jason gets you!
Contact:

Post by gamer2 » Fri Mar 17, 2006 9:01 pm

you guys are lucky, I have FST (Funtions, Statistics, AND Trigonometry) all in one class.
Image
Image

User avatar
HK-47
Moderator
Posts:3598
Joined:Thu Jul 15, 2004 2:17 pm
Location:/dev/moderator/
Contact:

Post by HK-47 » Sun Mar 19, 2006 10:17 am

Trig is easy. :) I wish my school had more difficult math courses... :|

User avatar
Lucretius
Moderator
Posts:4009
Joined:Mon Jan 31, 2005 7:25 pm
Location:*undisclosed*
Contact:

Post by Lucretius » Sun Mar 19, 2006 11:50 am

It's when you combine trig (specifically, inverse trig functions) and calculus topics like integrals and derivatives...that's when things start to hurt your head, right gan-man? :wink:
-Luke

User avatar
gannon
Moderator
Posts:6974
Joined:Sun Apr 04, 2004 4:48 pm
Location:Near that one big lake
Contact:

Post by gannon » Sun Mar 19, 2006 12:17 pm

A bit, what I really hate is when teachers spring a calc test that has a rule stating that the use of calculators is prohibited :P

User avatar
Lucretius
Moderator
Posts:4009
Joined:Mon Jan 31, 2005 7:25 pm
Location:*undisclosed*
Contact:

Post by Lucretius » Sun Mar 19, 2006 12:26 pm

I'll second that...especially when you ask: "What is the equation?"
"I gave it to you yesterday."
"Oh yeah, that and five other ones, which was I supposed to remember?"
"The one I'm testing you on now."
"Oh, thanks.."

:roll:
-Luke

Post Reply