• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Code for a circle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Code for a circle


  • Subject: Re: Code for a circle
  • From: Doug McNutt <email@hidden>
  • Date: Thu, 13 Mar 2003 12:49:22 -0700

At 13:49 -0500 3/13/03, Paul Skinner wrote:
>Can anyone explain the formula I should use to generate values for the position of a window such that the values all fall close to lying on a 30 pixel diameter circle ?

I'm not even going to try providing AppleScript syntax but. . .

set radius to 15 pixels
set centerx and centery to whatever you like

loop from phi = 0 to 2*Pi in, say. Pi/6 sized steps which is the same as looping from 0 to 360 degrees in 30 degree steps.

Then take x = centerx + radius * cos(phi) and y = centery + radius * sin(phi)

--
--> As a citizen of the USA if you see a federal outlay expressed in $billion then multiply it by 4 to get your share in dollars. <--
_______________________________________________
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.

References: 
 >Code for a circle (From: Paul Skinner <email@hidden>)

  • Prev by Date: Newbie question
  • Next by Date: Re: scripting mail to select mailboxes
  • Previous by thread: Code for a circle
  • Next by thread: Re: Code for a circle
  • Index(es):
    • Date
    • Thread