{{Short description|Shape between a square and a circle}} {{Distinguish|squared circle (disambiguation){{!}}squared circle}} {{Use British English|date=September 2013}} thumb|200px|right|Squircle centred on the origin ({{math|''a'' {{=}} ''b'' {{=}} 0}}) with minor radius {{math|1=''r'' = 1}}: {{math|''x''<sup>4</sup> + ''y''<sup>4</sup> {{=}} 1}}
A '''squircle''' is a shape intermediate between a square and a circle. There are at least two definitions of "squircle" in use, one based on the superellipse, the other arising from work in optics. The word "squircle" is a portmanteau of the words "square" and "circle". Squircles have been applied in design and optics.
==Superellipse-based squircle == In a Cartesian coordinate system, the superellipse is defined by the equation <math display="block">\left|\frac{x - a}{r_a}\right|^n + \left|\frac{y - b}{r_b}\right|^n = 1,</math> where {{math|''r''<sub>''a''</sub>}} and {{math|''r''<sub>''b''</sub>}} are the semi-major and semi-minor axes, {{mvar|a}} and {{mvar|b}} are the {{math|''x''}} and {{math|''y''}} coordinates of the centre of the ellipse, and {{mvar|n}} is a positive number. The prototypical squircle is then defined as the superellipse where {{math|1=''r''<sub>''a''</sub> = ''r''<sub>''b''</sub>}} and {{math|1=''n'' = 4}}. Its equation is:<ref name=Weisstein>{{MathWorld|Squircle}}</ref> <math display="block">\left|x - a\right|^4 + \left|y - b\right|^4 = r^4</math> where {{math|''r''}} is the radius of the squircle. Compare this to the equation of a circle. When the squircle is centred at the origin, then {{math|1=''a'' = ''b'' = 0}}, and it is called Lamé's special quartic.
The area inside this squircle can be expressed in terms of the beta function {{math|B}} or the gamma function {{math|Γ}} as<ref name=Weisstein/><math display="block">\begin{align} \text{Area} &= 4 \int_0^r \sqrt[4]{r^4-x^4} \, dx \\ &= 4r\int_0^r \sqrt[4]{1-\frac{x^4}{r^4}} \, dx \\ &= 4r^2 \int_{0}^{1} \sqrt[4]{1-u^4} \, du \\ &= \sqrt[4]{4}r^2 \int_0^\frac14 v^{-\frac34}\sqrt[4]{1-4v} \, dv \\ &= r^2 \int_0^1 (1-w)^\frac14 w^{-\frac34} \, dw \\ &= r^2 \int_0^1 (1-w)^{\frac54-1} w^{\frac14-1} \, dw \\ &= r^2 \cdot \operatorname{\Beta}\left(\tfrac14,\tfrac54\right) \\ &= 4r^2 \frac{\left(\operatorname{\Gamma} \left(1+\frac14\right)\right)^2}{\operatorname{\Gamma} \left(1+\frac24\right)} \\ &= \frac{8r^2 \left(\operatorname{\Gamma} \left(\frac54\right)\right)^2 }{\sqrt\pi} \\ &= \varpi \sqrt{2} r^2 \approx 3.708149 r^2, \end{align}</math> where {{mvar|r}} is the radius of the squircle, and {{mvar|ϖ}} is the lemniscate constant.
==={{math|''p''}}-norm notation=== In terms of the {{math|''p''}}-norm {{math|‖ · ‖<sub>''p''</sub>}} on {{math|ℝ<sup>2</sup>}}, the squircle can be expressed as:<math display="block"> \left\|\mathbf{x} - \mathbf{x}_c\right\|_p = r </math>where {{math|1=''p'' = 4}}, {{math|1='''x'''<sub>''c''</sub> = (''a'', ''b'')}} is the vector denoting the centre of the squircle, and {{math|1='''x''' = (''x'', ''y'')}}. Effectively, this is still a "circle" of points at a distance {{mvar|r}} from the centre, but distance is defined differently. For comparison, the usual circle is the case {{math|1=''p'' = 2}}, whereas the square is given by the {{math|''p'' → ∞}} case (the supremum norm), and a rotated square is given by {{math|1=''p'' = 1}} (the taxicab norm). This allows a straightforward generalization to a '''spherical cube''' ('''sphube'''), in {{math|ℝ<sup>3</sup>}}, or '''hypersphube''' in higher dimensions.<ref name="fong">{{cite arXiv|title=Squircular Calculations|author=Chamberlain Fong|eprint=1604.02174|year=2016|class=math.GM }}</ref> Different values of {{math|''p''}} may be used for a more general squircle, from which an analog to trigonometry ("squigonometry") has been developed.
== Fernández-Guasti squircle ==
Another squircle comes from work in optics.<ref>{{cite journal|journal=Int. J. Educ. Sci. Technol.| volume = 23|author = M. Fernández Guasti | title= Analytic Geometry of Some Rectilinear Figures| pages=895–901 |year=1992}}</ref><ref name="optik">{{cite journal |journal=Optik |volume=116 |pages=265–269 |year=2005 |url=http://investigacion.izt.uam.mx/mfg/pub/lcdpix_optik05.pdf |accessdate=20 November 2006 |doi=10.1016/j.ijleo.2005.01.018 |title=LCD pixel shape and far-field diffraction patterns |issue=6 |author1=M. Fernández Guasti |author2=A. Meléndez Cobarrubias |author3=F.J. Renero Carrillo |author4=A. Cornejo Rodríguez|bibcode=2005Optik.116..265F }}</ref> It may be called the Fernández-Guasti squircle or FG squircle, after one of its authors, to distinguish it from the superellipse-related squircle above.<ref name="fong" /> This kind of squircle, centered at the origin, is defined by the equation <math display="block"> x^2 + y^2 - \frac{s^2}{r^2} x^2 y^2 = r^2 </math> where {{mvar|r}} is the radius of the squircle, {{mvar|s}} is the squareness parameter, and {{mvar|x}} and {{mvar|y}} are in the interval {{closed-closed|−''r'', ''r''}}. If {{math|1=''s'' = 0}}, the equation is a circle; if {{math|1=''s'' = 1}}, it is a square. This equation allows a smooth parametrization of the transition to a square from a circle, without invoking infinity.
=== Polar form === The FG squircle's radial distance {{mvar|ρ}} from center to edge can be described parametrically in terms of the circle radius and rotation angle:<ref name="squircular">{{cite conference |title=Squircular Calculations |author=C. Fong |conference=Joint Mathematics Meeting 2018, SIGMAA-ARTS |year=2018 |eprint=1604.02174}}</ref>
<math display="block">\rho = \frac{r\sqrt{2}}{s|\sin{2\theta}|} \sqrt{1-\sqrt{1-s^2 \sin^2{2\theta}}}</math>
In practice, when plotting on a computer, a small value like 0.001 can be added to the angle argument {{math|2''θ''}} to avoid the indeterminate form {{sfrac|0|0}} when {{math|''θ'' {{=}} {{sfrac|''nπ''|2}}}} for any integer {{mvar|n}}, or one can set {{math|''ρ'' {{=}} ''r''}} for these cases.
=== Linearizing squareness === The squareness parameter {{mvar|s}} in the FG squircle, while bounded between 0 and 1, results in a nonlinear interpolation of the squircle "corner" between the inner circle and the square corner. If {{math|''s''<sub>L</sub>}} is the intended linearly-interpolated position of the corner, the following relationship converts {{math|''s''<sub>L</sub>}} to {{mvar|s}} for use in the squircle formula to obtain correctly interpolated squircles:<ref name="squircular" />
<math display="block">s = 2 \frac{\sqrt{\left(3-2\sqrt{2}\right)s_\mathrm{L}^2-2\left(1-\sqrt{2}\right)s_\mathrm{L}}}{(1-\left(1-\sqrt{2}\right)s_\mathrm{L})^2}</math>
== Periodic squircle == Another type of squircle arises from trigonometry.<ref name="fong2">{{cite arXiv|title=Visualizing Squircular Implicit Surfaces|author=C. Fong|eprint=2210.15232|year=2022|class=cs.GR }}</ref> This type of squircle is periodic in {{math|ℝ<sup>2</sup>}} and has the equation
<math display="block">\cos\left(\frac{s \pi x}{2 r}\right) \cos\left(\frac{s \pi y}{2 r}\right) = \cos\left(\frac{s \pi }{2 }\right) </math>
where {{mvar|r}} is the minor radius of the squircle, {{mvar|s}} is the squareness parameter, and {{mvar|x}} and {{mvar|y}} are in the interval {{open-open|−''r'', ''r''}}. As {{mvar|s}} approaches 0 in the limit, the equation becomes a circle. When {{math|1=''s'' = 1}}, the equation is a square.<ref>{{cite web |title=Periodic squircle |website=Desmos |url=https://www.desmos.com/calculator/cnmjtd2dwr |access-date=29 May 2026}}</ref>
== Similar shapes == thumb|A squircle ({{color|blue|blue}}) compared with a rounded square ({{color|red|red}}).
===Rounded square=== A shape similar to a squircle, called a ''{{visible anchor|rounded square}}'', may be generated by separating four quarters of a circle and connecting their loose ends with straight lines, or by separating the four sides of a square and connecting them with quarter-circles. Such a shape is very similar but not identical to the squircle. Although constructing a rounded square may be conceptually and physically simpler, the squircle has a simpler equation and can be generalised much more easily. One consequence of this is that the squircle and other superellipses can be scaled up or down quite easily. This is useful where, for example, one wishes to create nested squircles.
===Truncated circle=== thumb|Various forms of a truncated circle Another similar shape is a ''truncated circle'', the boundary of the intersection of the regions enclosed by a square and by a concentric circle whose diameter is both greater than the length of the side of the square and less than the length of the diagonal of the square (so that each figure has interior points that are not in the interior of the other). Such shapes lack the tangent continuity possessed by both superellipses and rounded squares.
===Rounded cube=== A ''rounded cube'' can be defined in terms of superellipsoids.
===Sphube=== Similar to the name ''squircle'', a ''sphube'' is a portmanteau of 'sphere' and 'cube'. It is the three-dimensional counterpart to the squircle. The equation for the FG-squircle in three dimensions is:<ref name="squircular" />
<math display="block">x^2 + y^2 + z^2 - \frac{s^2}{r^2}\left(x^2 y^2 + y^2 z^2 + x^2 z^2 - \frac{s^2}{r^2}x^2 y^2 z^2\right) = r^2</math>
In polar coordinates, the sphube is expressed parametrically as
<math display="block">\begin{align} x &= \frac{r \cos\theta\ \cos\phi}{\sqrt{1-s\cos^2\theta\sin^2\phi - s\sin^2\theta}}\\ y &= \frac{r \cos\theta\ \sin\phi}{\sqrt{1-s\cos^2\theta\cos^2\phi - s\sin^2\theta}}\\ z &= \frac{r \sin\theta}{\sqrt{1 - s\cos^2\theta}} \end{align}</math>
While the squareness parameter {{mvar|s}} in this case does not behave identically to its squircle counterpart, nevertheless the surface is a sphere when {{mvar|s}} equals 0, and approaches a cube with sharp corners as {{mvar|s}} approaches 1.<ref name="squircular" />
==Uses== thumb|Squircle-shaped porcelain dishes Squircles are useful in optics. If light is passed through a two-dimensional square aperture, the central spot in the diffraction pattern can be closely modelled by a squircle or supercircle. If a rectangular aperture is used, the spot can be approximated by a superellipse.<ref name="optik"/>
Squircles have also been used to construct dinner plates. A squircular plate has a larger area (and can thus hold more food) than a circular one with the same radius, but still occupies the same amount of space in a rectangular or square cupboard.<ref>{{cite web |publisher=Kitchen Contraptions |url=http://www.kitchencontraptions.com/archives/006830.php |title=Squircle Plate |access-date=20 November 2006 |url-status=dead |archive-url=https://web.archive.org/web/20061101032925/http://www.kitchencontraptions.com/archives/006830.php |archive-date=1 November 2006 }}</ref>
Many Nokia phone models have been designed with a squircle-shaped touchpad button,<ref>Nokia Designer Mark Delaney mentions the squircle in a video regarding classic Nokia phone designs:<br/>{{cite video |url=http://conversations.nokia.com/2009/06/17/nokia-6700-the-little-black-dress-of-phones/ |title=Nokia 6700 – The little black dress of phones |quote=See 3:13 in video |access-date=9 December 2009 |url-status=dead |archive-url=https://web.archive.org/web/20100106035910/http://conversations.nokia.com/2009/06/17/nokia-6700-the-little-black-dress-of-phones/ |archive-date=6 January 2010 |df= }}</ref><ref>{{cite web |title=Clayton Miller evaluates shapes on mobile phone platforms |url=http://interuserface.net/2011/06/own-a-shape/ |accessdate=2 July 2011}}</ref> as was the second generation Microsoft Zune.<ref>{{cite web |last1=Marsal |first1=Katie |title=Microsoft discontinues hard drives, "squircle" from Zune lineup |url=https://appleinsider.com/articles/09/09/02/microsoft_discontinues_hard_drives_squircle_from_zune_lineup |website=Apple Insider |date=2 September 2009 |access-date=25 August 2022}}</ref> Apple uses an approximation of a squircle (actually a quintic superellipse) for icons in iOS, iPadOS, macOS, and the home buttons of some Apple hardware.<ref>{{cite web |title=The Hunt for the Squircle |url=https://applypixels.com/blog/the-hunt-for-the-squircle |accessdate=23 May 2022}}</ref> One of the shapes for adaptive icons introduced in the Android "Oreo" operating system is a squircle.<ref>{{cite web |url=https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive.html | title=Adaptive Icons | accessdate=15 January 2018}}</ref> Samsung uses squircle-shaped icons in their Android software overlay One UI, and in Samsung Experience and TouchWiz.<ref>{{Cite web |title=OneUI |url=https://developer.samsung.com/OneUI/iconography/background.html |access-date=2022-04-14 |website=Samsung Developers |language=en}}</ref>
Italian car manufacturer Fiat used numerous squircles in the interior and exterior design of the third generation Panda.<ref>{{cite web |title=PANDA DESIGN STORY |url=http://www.fiatpress.com/download/2011/FIAT/FILES/111011_F_panda_design_story_en.pdf |accessdate=30 December 2018}}</ref>
==See also== * Squigonometry * Astroid * Ellipse * Ellipsoid * {{mvar|L<sup>p</sup>}} spaces * Oval * Squround * Superegg
==References== {{Reflist|30em}}
==External links== {{Commons category}} * {{YouTube|gjtTcyWL0NA|What is the area of a Squircle?}} by Matt Parker * [http://www.procato.com/superellipse/ Online Calculator for supercircle and super-ellipse] * [https://web.archive.org/web/20071203135224/http://www.geocities.com/dougtclark/mySquircle.html Web based supercircle generator]
Category:Geometric shapes Category:Plane curves Category:Quartic curves