Move #09
02 августа 1997 |
|
algorithm - One useful trick with ^ (an algorithm for the circle).
(C) Tom_HIAL / Ascendancy Cr.L. Grodno One useful trick c I wonder you ever tried draw a circle in the codes? Even if so, agree with me that you have left feeling that it is, well, if not the trash (Pre-made sprites), it is still something wrong ... Namely, in any more or less decent calculations as air need a table of squares. And how to do it each has its own methods ... I offer you the following method, and accurate method: first, it is important to understand that As, and then apply where deem necessary. Take a sheet of paper, draw sign a three-line and At least ten column (for ease of communication we agree that line is - s1, s2, s3 ,..., and columns - t0, t1, t2, t3, t4, t5 ...), then fill upper (s1) line numbers in ascending order starting from one end of the line (1,2,3,4,5 ,...), second (s2) line fill odd numbers in ascending order (1,3,5,7,9,11,13 and etc.). Now we will fill the last string (s3): to put it in position (S3, t0) unit, and then for each subsequent column, run the following operation: take the number from the third row previous column, add up the number of the second row of the current column, the result written in the third row in the current column go to the next column, do such actions for each column ... Well, why do it? And if you carefully look at the first and third row of columns, then do not even need to have seven spans Balde in to see: in the first row numbers and their squares in the third ... t0 t1 t2 t3 t4 s1 1 2 3 4 5 ... s2 1 3 5 7 9 ... / / / / s3 April 1 September 16, 1925 ... I would say more, the second line - auxiliary, and in the process of settlement can be generated from the first: take number from the first row the desired column multiply it by two (shift left) and yedinichku defraud. Circles, for example, such vykruntasah obtained becpodobno. Even easier to explain I can not. But who something in my head is, he will find and better use. Well, here today and all. Next time will tell something more ... p.s. That you do not @ throw to repay SH-shke ;-)
Other articles:
Similar articles:
В этот день... 21 November