Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: Re: FLASH: formule needed
From: unique
Date: Tue, 14 Mar 2000 00:58:26 GMT

>Hello chosen flash ones!
>
>Can someone think with me on this one:
>I need a formule which calculates every x & y cordinates in a circle.
>let say:
>
>radius =10
>x = 0
>y = 0
>
>so first point
>x=10;y=0
>
>So the next coordinates are?

I've read about folks' "square root" solution to this question, but
there may be something lacking in going the square root route :-) ,
if you're simply calculating y for incremental values of x, or vice
versa.

If you want *equally spaced* points along the circumference of the
circle, you'll need to work with trig instead of algebra. You want
constant/equal degrees of rotation.

Joe has determined that the first point, which we'll call the 0�
point, is at (10,0).

Let's say that we want 1� increments. If we want our next point at 1�
of rotation, we need to consider the trigonometry of a right triangle
with an angle of 1�. I'll draw it in accordance with the way Jos has
defined the initial 0� point:

(This will look like crap if you don't have a monospaced font in place.)

*
*
*
* (x,y)
*****
***** **
***** * *
***** 1� * *
(0,0) ********************* *
(x,0)

Since we know the length of the hypotenuse, we can use the formulas
for sine and cosine to retrofit a number for x and y above (x and y
are the lengths of the sides of the triangle).

So we end up with:

sin 1� = y / 10 and
cos 1� = x / 10

x = 0.175 and
y = 9.998

Now all ya have to do is work some ActionScript finesse to do the
same thing 360 total times (in this case of 1� increments), and,
there you go: equal arcs, all the way around.

Sorry if this was long-winded for some, but now it's "newbie friendly", too.

HTH,

Ken Sherwood


--

ATTENTION MACROMEDIA:

Historic plugins.
We want them.
We need them.
May we have them?
If not, why not?

flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and The Flash Film Festival
"The World�s Premier Flash Solutions Conference and Expo"
March 27-29, Nob Hill Masonic Center, San Francisco, California

-Register before Feb 25 and save $200!!-- www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  FLASH: formule needed, Wilbrink, Jos

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]