Article View: comp.lang.pascal.delphi.misc
Article #674Re: Buffon's Needles
From: Dr John Stockton
Date: Sat, 26 Jun 1999 00:00
Date: Sat, 26 Jun 1999 00:00
63 lines
4334 bytes
4334 bytes
JRS: In article <7l165c$gqa$1@bgtnsc02.worldnet.att.net> of Fri, 25 Jun 1999 19:22:15 in news:comp.lang.pascal.delphi.misc, Earl F. Glynn <EarlGlynn@att.net> wrote: >Dr John Stockton <jrs@merlyn.demon.co.uk> wrote in message >news:zZIi7jAzW8c3EwDD@merlyn.demon.co.uk... >> >It will be interesting to see whether you've managed to avoid using a >> >value for Pi, implicitly or explicitly, in the work. > >> Method 4 uses half-angle and angle-addition formulae to generate sines >> and cosines of evenly-spaced angles, starting with a "unit" of one >> right-angle > >There was no angle-addition formula used in Method 4. The rotation matrix is in effect a pair of addition formulae, surely? >The half-angle recurrence formulas only involves a SQRT, not any >trig function. The starting value is 0.0, i.e., cos(90 degrees). > >The generated sequences of SIN and COS values from the >recurrence relationship were just algebraic expressions. >Is your objection to an "implicit" use of PI because SINs and >COSs were used in the explanation? No; the full paragraph of mine reads "Method 4 uses half-angle and angle-addition formulae to generate sines and cosines of evenly-spaced angles, starting with a "unit" of one right-angle - these can then be randomly chosen, though it would be better for the final Buffon value to systematically use all of them (and to systematically evenly choose the needle-centres). But, since, for small x in radians, sin(x)=x, the angle-halving is itself essentially capable of determining the radian as a fraction of a right angle, which determines Pi." You are using, as part of your emulation of Buffon's random-needle Pi method, a systematic algorithm which itself essentially determines Pi; you don't import Pi, you virtually make it!. I can't imagine that it will make any significant difference to the final result, as standard computer arithmetic is reasonably precise : but, in principle, I think that one can improve (with a bit more head- scratching while programming) on repeatedly bifurcating a right angle and then continually rotating to get, in linear sequence, an equally- spaced set of angles filling the right angle. Starting with the zero- degree point, rotate it by half the right angle to get a second point, then repeatedly halve the angle and use rotation of each point by it to double the set of points - rounding errors will build up even less. If you have not already done so, it may be possible to make Method 3 a little quicker by using FSINCOS in the FPU so as to generate both SIN & COS in one move. Rather than using two crossed needles on floorboards, one can equally well, I imagine, use a single needle on a square-tiled floor. -- � John Stockton, Surrey, UK. jrs@merlyn.demon.co.uk / JR.Stockton@physics.org � Web <URL: http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links. Correct 4-line sig. separator is as above, a line precisely "-- " (SoRFC1036) Do not Mail News to me. Before a reply, quote with ">" or "> " (SoRFC1036)
Technical Details
Message-ID:
<J1oswjA3sQd3EwPp@merlyn.demon.co.uk>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7ks8ls$mgk$1@bgtnsc03.worldnet.att.net> <Im0c0MABmjc3Ew2K@merlyn.demon.co.uk> <zZIi7jAzW8c3EwDD@merlyn.demon.co.uk> <7l165c$gqa$1@bgtnsc02.worldnet.att.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10baee,d24982a2aa52a35f X-Google-Attributes: gid10baee,public X-Google-Thread: 10a726,d24982a2aa52a35f X-Google-Attributes: gid10a726,public X-Google-Thread: 109585,d24982a2aa52a35f X-Google-Attributes: gid109585,public X-Google-Thread: 105ac8,d24982a2aa52a35f X-Google-Attributes: gid105ac8,public X-Google-Thread: 10a7f1,d24982a2aa52a35f X-Google-Attributes: gid10a7f1,public From: Dr John Stockton <jrs@merlyn.demon.co.uk> Subject: Re: Buffon's Needles Date: 1999/06/26 Message-ID: <J1oswjA3sQd3EwPp@merlyn.demon.co.uk> X-Deja-AN: 494230058 Content-Transfer-Encoding: 8bit X-NNTP-Posting-Host: merlyn.demon.co.uk:158.152.233.145 References: <7ks8ls$mgk$1@bgtnsc03.worldnet.att.net> <Im0c0MABmjc3Ew2K@merlyn.demon.co.uk> <zZIi7jAzW8c3EwDD@merlyn.demon.co.uk> <7l165c$gqa$1@bgtnsc02.worldnet.att.net> Content-Type: text/plain;charset=iso-8859-1 X-Complaints-To: abuse@demon.net X-Trace: news.demon.co.uk 930429418 nnrp-01:4669 NO-IDENT merlyn.demon.co.uk:158.152.233.145 Organization: Home, Surrey, UK MIME-Version: 1.0 Newsgroups: comp.lang.pascal.delphi.misc,alt.comp.borland-delphi,de.comp.lang.pascal.delphi,fr.comp.lang.pascal,es.comp.lenguajes.delphi