Plotting points around a circle

Can somebody please show/tell me how to plot a number of points around a circle.

I know roughly it would be something like

local \_numofpoints = 5;  
local xScreenPos = 200  
local xScreenPos = 200  
local \_distance = 50  
  
local \_rotation = 2 \* math.pi / \_numofpoints  
  
for i = 0, \_numofpoints, -1 do  
 local circle = display.newCircle(0, 0, 10)  
  
 circle.x = xScreenPos + (i\*math.cos(\_distance) \* \_rotation)  
 circle.y = yScreenPos + (i\*math.sin(\_distance) \* \_rotation)  
end  

I know this a very simple request, but it’s been many years since I took high school maths.

Many Thanks

[import]uid: 88980 topic_id: 31227 reply_id: 331227[/import]

Just wondering if anybody can help me with this?

Thanks [import]uid: 88980 topic_id: 31227 reply_id: 125080[/import]

local numPoints = 5  
local xCenter = 200  
local yCenter = 200  
local radius = 50  
   
local angleStep = 2 \* math.pi / numPoints  
  
for i = 0, numPoints-1 do  
 local circle = display.newCircle(0, 0, 10)  
 circle.x = xCenter + radius\*math.cos(i\*angleStep)  
 circle.y = yCenter + radius\*math.sin(i\*angleStep)  
end  

Please note that you have to assign each circle to some group, or keep track of it in some other way because otherwise you have no way to remove it, and it will leak memory. [import]uid: 160496 topic_id: 31227 reply_id: 125088[/import]

Many thanks Mike. [import]uid: 88980 topic_id: 31227 reply_id: 125132[/import]

Just wondering if anybody can help me with this?

Thanks [import]uid: 88980 topic_id: 31227 reply_id: 125080[/import]

local numPoints = 5  
local xCenter = 200  
local yCenter = 200  
local radius = 50  
   
local angleStep = 2 \* math.pi / numPoints  
  
for i = 0, numPoints-1 do  
 local circle = display.newCircle(0, 0, 10)  
 circle.x = xCenter + radius\*math.cos(i\*angleStep)  
 circle.y = yCenter + radius\*math.sin(i\*angleStep)  
end  

Please note that you have to assign each circle to some group, or keep track of it in some other way because otherwise you have no way to remove it, and it will leak memory. [import]uid: 160496 topic_id: 31227 reply_id: 125088[/import]

Many thanks Mike. [import]uid: 88980 topic_id: 31227 reply_id: 125132[/import]