How can i get the position of a circle around a specific point?

Hey there!

Essentially what i need is help with math and calculations, to simplify my issue, i’ll use a part as an example.


Consider i have this part’s Position and i want to gather information about its proximities. What I specifically need is the positions of a circle around the part, sort of like this:

So it calculates a circle area around the part and gets me back the position of each of those yellow circles.

I also need the amount of lines and line distance to be modifiable. The amount of lines being modifiable basically means i can just send like 6 lines like the previous example and get back 6 positions or something like this, that gets me a lot more positions:

And the line distance being modifiable just means it can be shorter or longer, like this:


That’s about it, thanks!

1 Like

This is best solved with a bit of really basic trigonometry, more specifically the sin() and cos() functions.

You’re interested in the way those functions are related to each other, when it comes to the unit circle. I’m not really good at explaining, but there are plenty of resources available online for you to understand why this is the case.

local centre = Vector3.yAxis * 5

local partAmount = 10
local radius = 5

for index = 1, partAmount do
	-- pi*2 is a full circle
	local angle = (index - 1) / partAmount * math.pi * 2
	local offset = Vector3.new(math.sin(angle), 0, math.cos(angle)) * radius
	
	local part = Instance.new("Part")
	part.Position = centre + offset
	part.Size = Vector3.one * 1
	part.Parent = workspace
end

3 Likes

Thank you so much, that’s precisely what i was looking for!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.