## Trig Confusion

Hi There--

Am dynamically generating a shape.

Let's say I'm making a zig-zag, starting at 0,0 with points at 10, 10, then and a point at 20,0, and a point at 40, -10, repeating. I want to continue this for several iterations.

Now I want to offset this zig zag by three degrees to make the rest of the dynamically generated object. It would be a zig-zag pie shape, with the point at the origin.

Undaunted by the news that rotation can only be applied to movieclips, I was sure that I could figure it out using trig from high school.

I figured I'd populate an array with the calculations and work backwards down the array to get the shape.

I hurt myself this morning trying to figure out the math for this, using sins, cosins and tangents, then they're different for each quadrant, then what if it crosses an axis.

I used up a lot of notebook paper.

Then I came up with the idea for Flash to create an empty movie clip, put its alpha to zero, draw a line from the origin to the coordinate, rotate that, and depending on what quadrant it's in, extract either the height and width or the new x and y coordinates and populate the array with that.

I thought I was pretty spiffy.

However, I bet there's an even cleverer way to do this. I bet you guys know how.

I bet there's an elegant way to do this mathematically and I just got stuck in cosine land after being away for so long.