I am looking for the polar form of the following generalized superelliptic shape such that I can use it with NonLinearModelFit for curve fitting to data:

$$ \left | \frac{x}{a}\right |^{c1}+\left|\frac{y}{b}\right|^{c2}=1 $$

with Google I keep ending up with the further generalization by Gielis. But this one is a generalization too far for my purpose.

thanks for the help!

  • 4
    $\begingroup$ As it stands I feel this is a question for maths.SE. You could try reformulating as "can Mma find the polar form" or perhaps "why does NonLinearModelFit not work with the Cartesian form" but in any case it would be good to show what you have tried already. $\endgroup$ Commented Dec 22, 2015 at 17:49
  • $\begingroup$ Well, why don't you just fix $m=4$ in the Gielis formula to get the usual fourfold symmetry? $\endgroup$
    – user484
    Commented Dec 22, 2015 at 18:25
  • $\begingroup$ Fixing $m=4$ in Gielis indeed gives fourfold symmetry. It remains, however, that one is still left with three parameters to fit to (while I want just two). Additionally, one cannot rely on the usual convention that $a$ and $b$ are the lengths of the semi-major and semi-minor axes. What I can think of, to convert Gielis formula to generalized ellipse, would be that $$n_1=f(n_2,n_3)$$. With Gilies being:$$r(\theta)=\left[\left|\frac{cos\left(\frac{1}{4}m\theta\right)}{a}\right|^{n_2}+\left|\frac{cos\left(\frac{1}{4}m\theta\right)}{b}\right|^{n_3}\right]^{\frac{-1}{n_1}}$$ $\endgroup$ Commented Dec 23, 2015 at 9:12
  • $\begingroup$ apologies for not completing the formula, I ran out of time while editing. Here it is $$r(\theta)=\left[\left |{\frac{cos\left( \frac{1}{4}m\theta \right )^{n_2}}{a}} \right | +\left |{\frac{sin\left( \frac{1}{4}m\theta \right )^{n_3}}{b}} \right |\right]^{\frac{-1}{n_1}}$$ $\endgroup$ Commented Dec 23, 2015 at 9:25


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.