[Flashcoders] Shifting points 90 degrees

2007-04-24 Thread Adrian Lynch
Hey all,

I'm using the tutorial on building a carousel from gotoandlearn.com as the
basis of one that has a few more things it can do.

I'm having trouble with the placement of items on the circle at the
beginning.

The angle is derived with:

t.angle = i * ((Math.PI * 2) / numOfItems);

The x and y coords are derived with:

t._x = Math.cos(t.angle) * radiusX + centerX;
t._y = Math.sin(t.angle) * radiusY + centerY;

This starts the placement of the items on the circle starting at 3
o'clock(east), whereas I would like them to start at 6 o'clock(south).

How would I go about adding 90 degrees to the initial placement?

Cheers.

Adrian

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] Shifting points 90 degrees

2007-04-24 Thread Adrian Lynch
Through playng about, I've come up with changing:

t.angle = i * ((Math.PI * 2) / numOfItems);

to:

t.angle = (i * ((Math.PI * 2) / numOfItems)) + (Math.PI * .5);

Adding 90 degrees to all items.

Seems to work :O)

Adrian

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Adrian
Lynch
Sent: 24 April 2007 11:22
To: Flashcoders
Subject: [Flashcoders] Shifting points 90 degrees


Hey all,

I'm using the tutorial on building a carousel from gotoandlearn.com as the
basis of one that has a few more things it can do.

I'm having trouble with the placement of items on the circle at the
beginning.

The angle is derived with:

t.angle = i * ((Math.PI * 2) / numOfItems);

The x and y coords are derived with:

t._x = Math.cos(t.angle) * radiusX + centerX;
t._y = Math.sin(t.angle) * radiusY + centerY;

This starts the placement of the items on the circle starting at 3
o'clock(east), whereas I would like them to start at 6 o'clock(south).

How would I go about adding 90 degrees to the initial placement?

Cheers.

Adrian

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com