How could I find the equation of this "squircle"?

339 Views Asked by At

So I was messing around in Desmos with the following generic equation: $$f(x)^2+f(y)^2=25.$$ And it turns out that when: $$f(a)=\frac{1}{a^2-1},$$ which is to say: $$\left(\frac{1}{x^{2}-1}\right)^{2}+\left(\frac{1}{y^{2}-1}\right)^{2}=25,$$ then the resulting plot looks like this:

How would I go about finding the precise equation that gives ONLY the "squircle" that forms around the origin? My trial-and-error attempts have gotten me fairly close, but I would imagine some actual algebra/calculus is required to find the exact numbers. Thanks for your time!

3

There are 3 best solutions below

1
On BEST ANSWER

User Servaes notes that one can restrict $x,y$ to $[-1,1]$, but OP objects, wanting an equation with no extraneous restrictions. We can make the equation do the restricting for us. Any equation that has $\sqrt{1-x^2}$ in it automatically restricts $x$ to $[-1,1]$, since we don't do square roots of negative numbers. So $$\left({1\over\sqrt{1-x^2}}\right)^4+\left({1\over\sqrt{1-y^2}}\right)^4=25$$ is the same as the original equation, but with the necessary restrictions on $x,y$ implicit in the square root.

1
On

hint:

change variables to $x= \cos \alpha,\; y= \cos \beta$ with $0 \le \alpha, \beta \le \pi$ so both $x$ and $y$ will remain in $[-1,1]$

0
On

This is not in the form you wanted ($x^{2a} + y^{2a} = C$), but we can get an equation that gives you only the "squircle" in the middle.

First, we start by multiplying out the denominators, just to get a cleaner expression. Also, we want the part of the graph where $|x|,|y|<1$, so it's more natural to write $1-x^2,1-y^2$ than $x^2-1,y^2-1$, since the first are positive in the region we are interested in. So we get:

$$(1-x^2)^2 + (1-y^2)^2 = 25(1-x^2)^2(1-y^2)^2$$

This is still equivalent to your original equation and gives the same graph. So, now we can take the square root of both sides, and we get two possible graphs depending on which sign we choose. It turns out that the one that includes the squircle is:

$$\sqrt{(1-x^2)^2 + (1-y^2)^2} = 5(1-x^2)(1-y^2)$$

If you graph this (https://www.wolframalpha.com/input/?i=sqrt%28%281-x%5E2%29%5E2+%2B+%281-y%5E2%29%5E2%29+%3D+5%281-x%5E2%29%281-y%5E2%29) you can see it still includes the "corner pieces", since $(1-x^2)(1-y^2)$ is also positive in that region. How do we solve that? We want each factor of the product to be positive, so we separate them and take the square root:

$$\frac{\sqrt{(1-x^2)^2 + (1-y^2)^2}}{1-x^2} = 5(1-y^2)$$ $$\sqrt{\frac{\sqrt{(1-x^2)^2 + (1-y^2)^2}}{1-x^2}} = \sqrt{5(1-y^2)}$$

and this does give you exactly what you want.

We can also write it perhaps more neatly as:

$$\sqrt[4]{(1-x^2)^2 + (1-y^2)^2} = \sqrt{5}\sqrt{1-x^2}\sqrt{1-y^2}$$

https://www.wolframalpha.com/input/?i=%5Csqrt%5B4%5D%7B%281-x%5E2%29%5E2+%2B+%281-y%5E2%29%5E2%7D+%3D+%5Csqrt%7B5%7D%5Csqrt%7B1-x%5E2%7D%5Csqrt%7B1-y%5E2%7D