Sponsored Links

Jumat, 29 Juni 2018

Sponsored Links

math - Draw iOS 7-style squircle programmatically - Stack Overflow
src: i.stack.imgur.com

A squircle is a mathematical shape intermediate between a square and a circle. It is a special case of a superellipse. The word "squircle" is a portmanteau of the words "square" and "circle".


Video Squircle



Equation

In a Cartesian coordinate system, the squircle centred on the point (ab) with axes parallel to the coordinate axes is described by the equation:

( x - a ) 4 + ( y - b ) 4 = r 4 {\displaystyle \left(x-a\right)^{4}+\left(y-b\right)^{4}=r^{4}}

where r is the minor radius of the squircle (cf. equation of a circle).

The case that is centred on the origin (that is, with a = b = 0) is called Lamé's special quartic.

When a = b = 0 so that the squircle is centered at the origin, this equation can be expressed parametrically, using the sign function sgn ( . ) {\displaystyle \operatorname {sgn} (.)} , as

x ( t ) = | cos t | 1 2 ? r sgn ( cos t ) y ( t ) = | sin t | 1 2 ? r sgn ( sin t ) . {\displaystyle {\begin{aligned}x\left(t\right)&={|\cos t|}^{\frac {1}{2}}\cdot r\operatorname {sgn} (\cos t)\\y\left(t\right)&={|\sin t|}^{\frac {1}{2}}\cdot r\operatorname {sgn} (\sin t).\end{aligned}}}

Maps Squircle



Area

The area inside the squircle can be expressed as the area of a superellipse with n = 4 in terms of the gamma function, ?(x), as

A r e a = 4 r 2 ( ? ( 1 + 1 4 ) ) 2 ? ( 1 + 2 4 ) = 8 r 2 ( ? ( 5 4 ) ) 2 ? ? 3.708 r 2 , {\displaystyle \mathrm {Area} =4r^{2}{\frac {\left(\Gamma \left(1+{\tfrac {1}{4}}\right)\right)^{2}}{\Gamma \left(1+{\tfrac {2}{4}}\right)}}={\frac {8r^{2}{\big (}\Gamma {\big (}{\frac {5}{4}}{\big )}{\big )}^{2}}{\sqrt {\pi }}}\approx 3.708r^{2},}

where r is the minor radius of the squircle.

Another area expression is

A r e a = S 2 r 2 , {\displaystyle \mathrm {Area} ={\frac {S}{\sqrt {2}}}r^{2},}

where S is the lemniscate constant.


Drawing a squircle shape on canvas (Android) - Stack Overflow
src: i.stack.imgur.com


Generalisation

The squircle is a specific case (found by setting n = 4) of the class of shapes known as "supercircles", which have the equation

| x - a | n + | y - b | n = | r | n . {\displaystyle \left|x-a\right|^{n}+\left|y-b\right|^{n}=|r|^{n}.\,}

The taxonomy is not consistent -- some authors refer to the class as "supercircles" and the specific case as a squircle, while others adopt the opposite naming convention. Supercircles in turn are a subset of the even more general "superellipses", which have the equation

| x - a r a | n + | y - b r b | n = 1 , {\displaystyle \left|{\frac {x-a}{r_{a}}}\right|^{n}\!+\left|{\frac {y-b}{r_{b}}}\right|^{n}\!=1,\,}

where ra and rb are the semi-major and semi-minor axes. Superellipses were extensively studied and popularized by the Danish mathematician Piet Hein.

Considering the Euclidean plane a normed vector space, the squircle is a particular case of a circle

? x - x c ? p = r {\displaystyle \|\mathbf {x} -\mathbf {x} _{c}\|_{p}=r}

where ? ? ? p {\displaystyle \|\cdot \|_{p}} is the p-norm (for the case p=4) in R 2 {\displaystyle \mathbb {R} ^{2}} (cf. Lp norm), x c = ( a , b ) {\displaystyle \mathbf {x} _{c}=(a,b)} is the vector denoting the center of the squircle, and x = ( x , y ) {\displaystyle \mathbf {x} =(x,y)} . These represent the set of points which are at a distance r from the center, but the concept of distance has been redefined. The usual circle is the case p=2, whereas the square is given by the p -> ? {\displaystyle p\to \infty } case (the supremum norm).


The Squircle Is The Hottest Thing In Car Design Right Now
src: i.kinja-img.com


Similar shapes

A shape similar to a squircle, called a rounded square, may be generated by separating four quarters of a circle and connecting their loose ends with straight lines. 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 the 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.

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.


Sine by π/4 Squircle | It's very slightly different, but int… | Flickr
src: c1.staticflickr.com


Uses

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.

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. This is even more true of a square plate, but there are various problems (such as fragility, and difficulty of wiping up sauce) associated with the corners of square plates.

Sumvision manufactures an SD card-based MP3 player named Squircle for the budget market. It is not, however, a genuine squircle, although vaguely similar in shape.

Nokia is closely associated with the squircle, having used it as a touchpad button in many phones.

Italian car manufacturer Fiat used numerous squircles in the interior and exterior design of the third generation Panda.

Apple Inc. uses a shape that resembles a squircle in its iOS mobile operating system as the shape of app icons, but it is not actually a squircle but an approximation of a quintic superellipse. The same shape also used to be seen in iOS devices (currently only in the iPod Touch) on the home button.

One of the shapes for adaptive icons available in the Android "Oreo" operating system is a squircle.


Colorado Squircle Coffee Table - Pole Legs - W600mm
src: www.springfieldeducationalfurniture.co.uk


See also

  • Astroid
  • Ellipse
  • Ellipsoid
  • Lp spaces
  • Oval
  • Superegg

Accuracy â€
src: www.masterdressagelessons.com


References


youtube dark squircle | | Free Vector Icons
src: www.vectorico.com


External links

  • Online Calculator for supercircle and super-ellipse
  • Web based supercircle generator

Source of the article : Wikipedia

Comments
0 Comments