Okay so I can show you the code to start with and then explain some of my problems:
local Origin = workspace.Origin
local Edge = workspace.Edge
local Mover
local Radius
local EdgeCoordinate = {Edge.Position.X, Edge.Position.Z}
local OriginCoordinate = {Origin.Position.X, Origin.Position.Z}
local function calcDistance(P1, P2)
return math.sqrt(((P2[1]-P1[1])^2) + ((P2[2]-P1[2])^2))
end
local function calcEdge(origin, radius, theta)
local x1 = (origin[1]+radius) * math.cos(theta)
local y1 = (origin[2]+radius) * math.sin(theta)
return {x=x1, y=y1}
end
Radius = calcDistance(OriginCoordinate, EdgeCoordinate)
for i = 0, 2*math.pi, .01 do
local Part = Instance.new("Part")
Part.Size = Origin.Size
Part.BrickColor = BrickColor.new("Royal purple")
local Point = calcEdge(OriginCoordinate, Radius, i)
Part.Anchored = true
Part.Position = Vector3.new(Point.x, 0, Point.z)
Part.Parent = workspace
print(Point.x, Point.y)
wait()
end
So considering that I’m given an edge of the circle, I can use the distance formula of square root of (x2-x1)^2 + (y2-y1) ^2. And by finding the distance from the outer edge given p1 as the origin and p2 as the edge, I can calculate the radius with distance from the two given points. Doing this I could also plug in the parametric equation of circles to find points on the edge of a circle given: Radius, Theta, and Origin (mid). But the problem is the code I wrote results in the gif below, which is more of an oval and doesn’t seem to be respecting the origin points given since the origin and the edge don’t seem equally spaced with the radius.
https://gyazo.com/03952182af5c3af9a5c6ac28031ca409.gf
If someone can help me out with this, that’d be really appreciated. Thank You in advance!