Finding coordinates around a circle when given an angle

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
SamPerson12345
Prole
Posts: 41
Joined: Sat Aug 30, 2008 5:35 pm

Finding coordinates around a circle when given an angle

Post 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
emonk
Prole
Posts: 24
Joined: Tue Aug 12, 2008 11:43 am

Re: Finding coordinates around a circle when given an angle

Post 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.
Sarcasm - just one of the services I offer.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 11 guests