Re: Geometry problems
Re: Geometry problems
- Subject: Re: Geometry problems
- From: Malcolm Fitzgerald <email@hidden>
- Date: Sun, 4 Aug 2002 22:59:58 +1000
That's very cute, I'm saving it to impress children and adults alike.
On Sunday, August 4, 2002, at 09:15 PM, Andy Wylie wrote:
on 2/8/02 11:51 PM +1200: Malcolm Fitzgerald wrote:
Can anyone lead me back through the fog to my high school maths
formulae?
I'm trying to calculate points on the circumference of an arc in an
AppleWorks drawing frame. I want to place rotated text frames on the
circumference. I've been able to figure out that the angle of rotation
for the text frame is the tangent at that point on the circumference:
( 360 - start angle - [portion of arc angle] + rotation ) mod 360
Now I just need to know where to put them.
this still needs some minor sorting, if you fix something please let me
know...
display dialog "Number of Degrees" default answer "90"
set arcDeg to text returned of result as number
display dialog "Number of letters" default answer "12"
set nSec to text returned of result as number
display dialog "Radius" default answer "60"
set r to text returned of result as number
on injuns(arcDeg, arcSlash, nSec, r)
set arcSlash to (360 / (arcDeg)) * 0.25
set theta to (arcDeg / nSec)
set theta to (theta / arcSlash) * pi / 180
set t to 0
set cart to {}
repeat nSec times
set x to round (r * (cos t))
set y to round (r * (sin t))
set end of cart to {x, y}
set t to t + theta
end repeat
return cart
end injuns
--Test
set cart to injuns(360, 0.25, 50, 100)
tell application "Finder" to activate
repeat with n from 1 to count cart
tell application "Finder"
make new folder at desktop with properties {name:n as string,
position:{(cart's item n's item 1) + 250, (cart's item n's item 2) +
250}}
end tell
end repeat
_____________________________ Andy
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.