Page 1 of 1

Finding coordinates around a circle when given an angle

Posted: Sat Sep 06, 2008 1:01 am
by SamPerson12345
I need to be able to find coordinates around a circle for a game I'm making. All help is greatly appreciated. :3

Re: Finding coordinates around a circle when given an angle

Posted: Sat Sep 06, 2008 2:55 am
by emonk
The x,y coordinates of a point on the perimeter of a circle are given by:

Code: Select all

x = radius * math.cos(angle);
y = radius * math.sin(angle);
The math library trig functions take angles expressed as radians, so be aware of conversion if that's not how you express your angles. Look up the math.rad() and math.deg() library functions in the Lua docs.