Please see the formulæ below.
It’s the solution to a circle chord problem where A is the arc length and C is the chord length.
I want to find the Radius r.
The formula below uses factorials and powers etc which I don’t know how to express in Objective C.
Can somebody help by converting the formula into Objective C language?
a = A² – C²
b = -2A^4/4!
c = 2A^6/6!
d = -2A^8/8!
//Let:
f = c/a-b²/3a²
g = d/a+2b³/27a³-bc/3a²
x = cuberoot(-g/2 + sqrt(g²/4+f³/27)) – cuberoot(g/2 + sqrt(g²/4+f³/27)) - b/3a
r = sqrt(x)
This should work:
…