Hi all,

I'm trying to work out how to position and draw lines around a circle. I have a circle drawn and I wish to put "rays" coming off it, like how you would draw a sun as a child.

I'm having trouble working out how to get the x, y and rotation that I need though. The rays are bitmaps so I need to position and rotate them.

Does anyone know what the algorithm would be for working out the position, where I could specify the degrees? Like if I said I have a circle that is origin 0, 0 and radius of 100, I could say I want the position at 45 degress? So I could get x and y on the circle's edge at 45 degees then? But I need it to work on any specified degree, like I could want 18 or something. It could then get the x and y of 18 on the edge and the rotation to make the image so that the ray comes right out of it in a line?

Any help appreciated.