#💬 fevoooʹs Feedback

1 messages · Page 1 of 1 (latest)

opal thicketBOT
winged viper
#

@golden lantern would be drooling

merry scaffold
#

the code isnt very clean 😞, but sure

#

where do you want me to send it?
\

winged viper
#

@golden lantern some functions you would want

local function Distance(Point1, Point2)
    return (Point1 - Point2).Magnitude
end

local function CalculateCircumcenter(P1, P2, P3)
    local ABMidPoint = (P1 + P2) / 2
    local BCMidPoint = (P2 + P3) / 2

    local ABSlope = (P2.Z - P1.Z) / (P2.X - P1.X)
    local BCSlope = (P3.Z - P2.Z) / (P3.X - P2.X)

    if BCSlope == 0 then
        BCSlope = 1e-6
    end

    local BisectorABSlope = -1 / ABSlope
    local BisectorBCSlope = -1 / BCSlope

    local IntersectAB = ABMidPoint.Z - BisectorABSlope * ABMidPoint.X
    local IntersectBC = BCMidPoint.Z - BisectorBCSlope * BCMidPoint.X

    local CircumCenterX = (IntersectBC - IntersectAB) / (BisectorABSlope - BisectorBCSlope)
    local CircumCenterZ = BisectorABSlope * CircumCenterX + IntersectAB

    return Vector3.new(
        CircumCenterX,
        0,
        CircumCenterZ
    )
end

local function CalculateCircumradius(P1, P2, P3)
    local A = Distance(P1, P2)
    local B = Distance(P2, P3)
    local C = Distance(P1, P3)

    return (A * B * C) / math.sqrt(((A + B + C) * (B + C - A) * (C + A - B) * (A + B - C)))
end
```:)
#

one important thing to note though, if your point is alone in the far corner it will bug out sometimes

#

also this happens sometimes, idk why

#

lol

merry scaffold
winged viper
#

im so confused, there is absolutely nothing wrong in my system yet it does this 💀

merry scaffold
#

is your supertriangle big enough? im not sure if it really correlates but that could be an issue

winged viper
#

it seems like its the edge detection issue, everything seems correct

winged viper
#

nvm, my previous code didnt account for a tiny edge case

merry scaffold
#

oh what was the edge case?