[Thread Prev] [Thread Next]
Subject: 
RE:MIA, Ask an Expert: octagon diagonals 
From: 
mwforum@xxxxxxxxxxxxxxxxxx (Dan Stone) 
Date: 
Wed, 2 Jun 2004 06:37:22 0400 
Thank you, Daniel.
As usual I focused too narrowly on the problem and missed most of it.
Sigh.
I haven't tried your code yet, but am looking forward to doing so.
I will also be checking out the math site.
Thans again.
Dan
Original Message
From: mwforumadmin@xxxxxxxxxxxxxxxxxx
[mailto:mwforumadmin@xxxxxxxxxxxxxxxxxx] On Behalf Of Daniel Ajoy
Sent: Tuesday, June 01, 2004 12:15 AM
To: mwforum@xxxxxxxxxxxxxxxxxx; orangetow@xxxxxxxxx
Subject: [MWForum]RE:MIA, Ask an Expert: octagon diagonals
> > from: orangetow@xxxxxxxxx
> > date: Sun, 30 May 2004 7:54:02 0600
> >
> > if an octagon's diagnals are 139.25 inches,
> > how long is each of its 8 sides
On 30 May 2004 at 17:52, Dan Stone wrote:
> My quick and dirty procedure  I just changed the side length until
the
> shape could 'hold' the diagonals
> that were drawn as 2 rectangles.
But there are other diagonals (image attached)
graphic
I found that out, here:
http://mathworld.wolfram.com/PolygonDiagonal.html
> Okay, have I made a mountain out of a molehill? <grin>
> What would be a better way to have done this?
I used these procedures to find each possible length:
to octagon :x
cg
t1,
pu home pd repeat 8 [fd :x rt 45]
t2,
pu home pd repeat 2 [fd :x rt 45]
op distance "t1
end

to octagon :x
cg
t1,
pu home pd repeat 8 [fd :x rt 45]
t2,
pu home pd repeat 3 [fd :x rt 45]
op distance "t1
end

to octagon :x
cg
t1,
pu home pd repeat 8 [fd :x rt 45]
t2,
pu home pd repeat 4 [fd :x rt 45]
op distance "t1
end

Since we want the distance that is the output of octagon
to be 139.25 in each case we could use trial and error
for each of the three possible lengths. But we can also use
this "find" procedure. It is fun to see it working.
to find :func :ini :fin
if 0.001 > abs :ini  :fin [op :ini]
let [mid (:ini + :fin) / 2]
let [fini run se :func :ini]
let [ffin run se :func :fin]
let [fmid run se :func :mid]
if :fini * :fmid < 0 [op find :func :ini :mid]
if :fmid * :ffin < 0 [op find :func :mid :fin]
end
; with repeat 2
show find [139.25  octagon] 50 100
75.3608703613
; with repeat 3
show find [139.25  octagon] 50 100
57.6789855957
; with repeat 4
show find [139.25  octagon] 50 100
53.288269043
Project attached.
Daniel
OpenWorld Learning
Attachment:
OCTAGON.GIF
Description: Binary data
Previous by thread:
RE:MIA, Ask an Expert: octagon diagonals
Next by thread:
Re: MIA, Ask an Expert Question
To save an attachment to your computer, PC users should rightclick (Mac users, click and hold the mouse button) on the link and then choose 'save target as' from the popup menu. A window will then pop up in which you can choose a location for the file.
