Sauda,c~oes, Mando esta mensagem com dois propósitos: ver se ela realmente é enviada (já mandei diversas que nunca chegaram) e apresentar um algoritmo para calcular as funções trigonométricas para quem (como o autor) se pergunta como isto poderia ter sido feito sem os recursos e conhecimentos de hoje. É um pouco longo e por isso talvez só merecerá uma leitura dos membros dos comitês editoriais das revistas da SBM (Eureka e RPM talvez). Como motivação, copio e colo o trecho que aparece mais abaixo: Here is an example: Say we want to calculate sin and cos of angle 17.448 degrees to 3 decimal places. Therefore we will use 4 decimal places for all the steps that follow []'s Luís
> From: b_balev...@yahoo.com > Subject: Re: Geometric Methods of Calculating Trigonometric Funtions > Date: Thu, 23 Apr 2009 21:42:34 +0000 > To: appr...@support1.mathforum.org > To: geometry-coll...@support1.mathforum.org > > Hello, guys. > > I believe I can give a good answer to the question you ask. > > If I understand your question correctly, this is the exact question I have > been asking myself part of my life. And during that time I have done quite > some searches to find a good answer. I've found several methods, but most of > them would not satisfy me: > > 1. Many calculators and computers generally use Taylor's series (plus maybe > small tables). This is the fastest method, I believe, but I didn't like it > because you need to convert the angle to radians to use that method, and thus > the accuracy of the method is limited to the accuracy of your knowledge of PI. > > 2. Other calculators and computers reportedly use CORDIC algorithm. It is > good, clean algorithm, and requires no multiplication. But was not satisfied > by CORDIC either, because in order to use it you need to prepare a table of > atan(2^(-n)), and some people find it difficult to understand (not me of > course, ;-P). > > 3. And then one day I discovered my own simple algorithm. It is not the > fastest one out there, and is not the easiest to use for calculation. But > still it is reasonably good, does not require previously calculated values, > can be carried to an arbitrary level of accuracy, can calculate sin, cos, tan > etc, their inverses, and does not need you to know PI at all. Actually, it > can be used to calculate PI, though I am not going to explain in detail how, > it is not difficult... In addition, it does not require a specific angular > unit to be used, any convenient unit will do. > > I was proud of myself and satisfied at last. I give a detailed description > below, as I have seen several people here in the net asking essentially the > same question. > > Of course the method is not at all a secret. I once saw almost exactly the > same algorithm published by a math teacher here in the net, but I forgot > where I saw it and who the teacher was. Still, I have seen it only once, and > I think it deserves more attention. > > First, here are some simple things you need in advance: > > 1. You need to know how to add, subtract, multiply, divide and find square > roots or positive numbers which are a little smaller than 1. Not very many > people nowadays can find square roots, but the best method I know is the > newtons method. I believe that anybody should know that algorithm, and even > should be able to discover it without external help, it is not that > difficult. Mesopotamian people did, as far as I know. If you like me to show > you an easy way of "discovering" the Newtons method for square roots, drop me > a letter at b_balevsky at yahoo.com. (I would love to know how many people > like what I write here. Or maybe dislike it. Or just hate me... whatever :-)) > > 2. If you have the coordinates of the end points of a linear segment in > rectangular coordinate system, you can find the midpoint of the segment by > averaging the coordinates. For instance, let's have a segment with end points > at (3, 4) and (1, 8). The coordinates of its middle point are (2, 6), because > 2 = (3+1)/2 and 6 = (4 + 8) / 2. > And this is the exact location of the midpoint. > > 3. If you have a segment and one of the ends of that segment is point (0,0) > then the coordinates of the other end of the segment (x,y) can give you the > length of that segment simply by using the Pythagorean theorem: Length = > square_root_of(x * x + y * y). Now suppose you divide both x and y by that > length. > By doing this, you have in effect "extended" or "shortened" the segment, but > you have _NOT_ changed its slope at all! The new segment has length of > exactly 1, meaning its end is on the unit circle. > > Those things said, here is how you would use the algorithm: > > 1. Simplify/transform the problem so that the angle in question is between 0 > and 90. This should be easy to to in all cases. > > Now you either have got a particular angle and want to know its sin/cos/tan, > or you have sine cos or tan, and want to know the angle. All other cases > should be easily to reduce to those two. The algorithm is almost the same for > both tasks. > > Start with two segments. Both will be radii of the unit circle. Initially, > one of the segments will be horizontal, starting from (0,0), ending at (1,0). > The other will be vertical, starting from (0,0) and ending at (0,1). > During the steps of the algorithm, we will move the ends which lay on the > unit circle. Each step will halve the angle between the segments by moving > one of the two segments in the middle. We will be careful to choose which of > the two segments we move in such a way that the interesting angle A always > falls between the segments. > Theoretically, the two segments will never coincide, of course. But in > practice, after relatively few steps, they will be sufficiently close > together for any practical purpose. > > Here is an example: Say we want to calculate sin and cos of angle 17.448 > degrees to 3 decimal places. Therefore we will use 4 decimal places for all > the steps that follow: > > Here is how we proceed: > Initially, the endpoints of the segments will be: > x1 = 1, y1 = 0, > x2 = 0, y2 = 1, > > and the angles will be > a1 = 0, a2 = 90 degrees. > > Now find the mid-angle between the two: > the new "a" will be midway between a1 and a2, which is > (a1 + a2) / 2, which is 45. > > This means, we will have to move the second segment, in order to maintain the > 17.44892 between the two segments. > We already know what will be the new angle a2, but we need to calculate also > new values for the x2, y2: > > Find the midpoint of between the ends of the two segments by averaging the > old endpoints of x1,y1 and x2,y2: this gives x = 0.5 and y = 0.5. So the new > segment is along the line from (0,0) to (0.5, 0.5), but this segment is too > short: we need to move the point (0.0, 0.5) so that it falls on the unit > circle thus extending the segment to unit length, while being careful not to > change the slope of the segment. This is done by multiplying dividing both > coordinates to the length of that short segment. And we calculate the length > using the Pythagorean theorem: > > length = sqrt(0.5 * 0.5 + 0.5 * 0.5) = sqrt(0.5) = 0.7071 > > Dividing both coordinates in (0.5, 0.5) by 0.7071 gives the new point > (0.7071, 0.7071). > > And so we now have: > a1 = 0, x1 = 1, y1 = 0 > a2 = 45, x2 = 0.7071, y2 = 0.7071 > > And this is all we need to proceed further to the next step. > > At all times, y1 = sin(a1), x1 = cos(a1), > and similarly y2 = sin(a2), x2 = cos(a2). > > We can now see that if y1 and y2 differ by less than 0.001, we have reduced > the range sufficiently and we have found our answer. > > Here is what we get by continuing this process further: > Each row represents the state of the algorithm between successive steps. > > a1 x1 y1 a2 x2 y2 > --------------------------------------------------- > 0 1 0 45 0.7071 0.7071 > 0 1 0 22.5 0.9239 0.3827 > 11.25 0.9807 0.1951 22.5 0.9232 0.3827 > 16.875 0.957 0.2904 22.5 0.9232 0.3827 > 16.875 0.957 0.2904 19.6875 0.9415 0.3370 > 16.875 0.957 0.2904 18.2813 0.9495 0.3138 > 16.875 0.957 0.2904 17.5782 0.9533 0.3021 > > At the last step, something interesting happened, and it will always happen > at some step: when we calculate the midpoint, and project it on the unit > circle, we see that we need not move that point at all - it is already on the > unit circle within the error of our four decimals. > > This means that from now on, we don't have to do all that complicated stuff > to calculate the sin we needed: we can just interpolate linearly, and that > will directly give us our answer. If anybody wants to keep it simple and > stupid, go ahead, continue with the iterations, that wont' hurt, and the > result should be the same. I prefer the interpolation: > > Sin(a) = y1 + (y2 - y1) * (A - a1) / (a2 - a1) > sin(a) = 0.2999, and even the last digit is correct, though you cannot count > on it in general, of course. > > The result using a calculator is .29985... and "you have found correct", as > the Egyptian scribe Ahmes would have said. > > A note about choosing how many digits to use in your calculations: > > At each step, the range is halved. So to get accuracy of 1/1024 we will need > about 10 steps (as 1/1024 = 1/(2^10)). > Those 10 steps means that the error introduced in the final result will be > something like 10 times the error due to rounding in each single step. > > So if you needed to calculate 9 digits, this would be about 30 steps (at > most), so you may need 2 digits more accuracy in the calculations than the > desired accuracy in the result, meaning all calculations should be carried to > 11 decimals. That's because you will now accumulate error from 30 steps, and > that may be up to 30 times the errors introduced by a single step. That said, > the algorithm is very reliable and accurate. > > The algorithm can also find angles given the sine. The steps above remain > mostly the same, the only thing that changes is the way you decide which > segment to move at each step. > > In our example, we looked at the mid-angle and see which of the two new > ranges contained our angle A. > > To calculate inverse sin, for instance, you would look at the mid-y, to > calculate inverse cos you would decide using the mid-x, atan can be reduced > to asin or acos, etc. > > All circular trig functions included. Money-back guarantee ;-) ========================================================================= Instruções para entrar na lista, sair da lista e usar a lista em http://www.mat.puc-rio.br/~obmlistas/obm-l.html =========================================================================