BBS: Inland Empire Archive Date: 11-27-92 (16:28) Number: 360 From: RICH GELDREICH Refer#: NONE To: BRETT LEVIN Recvd: NO Subj: Re: Challenge! Conf: (2) Quik_Bas
> Yes, that's what I was talking about. Use a routine like that, > and the spheres would be realistically shaded too, instead of just the > basic orb type of thing. How is a square root done in asm? Thanks! I found a great algorithm in my encyclopedia, and used it in that 3-D sphere program I sent you(you did see that, didn't you? I sent the source along with it). Let me see... It works *something* like this. Let's say we wanted to find the square root of, 100. First pick an approximate answer, say 5, and set Answer equal to this number: Answer = 5 Then, in a loop, find the average of the number you want the square root of divided by your current answer, and your answer: FOR A=1 to iterations Answer=(100/Answer+Answer)/2 NEXT Answer=square root The number of iterations, and how close your estimate is, determines how close your final answer is. Simple! I'm pretty sure that's what I used(my memory isn't that great). Rich > > Brett > > PS- Do I get the $20 microdollars? :-) Would a check be okay? :-) Sure you do! --- MsgToss 2.0b * Origin: Computer Co-Op - Voorhees, NJ | Ted Hare (1:266/29)
Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET