The Generalized Gielis Geometric Equation and Its Application

: Many natural shapes exhibit surprising symmetry and can be described by the Gielis equation, which has several classical geometric equations (for example, the circle, ellipse and superellipse) as special cases. However, the original Gielis equation cannot reflect some diverse shapes due to limitations of its power-law hypothesis. In the present study, we propose a generalized version by introducing a link function. Thus, the original Gielis equation can be deemed to be a special case of the generalized Gielis equation (GGE) with a power-law link function. The link function can be based on the morphological features of different objects so that the GGE is more flexible in fitting the data of the shape than its original version. The GGE is shown to be valid in depicting the shapes of some starfish and plant leaves.


Introduction
In geometry, the equation of a circle in the Euclidean plane is usually expressed as where x and y are the coordinates of the circle on the x-and y-axes, respectively, with r the radius. The circle is a special case of that of an ellipse: where A and B (A ≥ B > 0) represent the major and minor axis semi-diameters, respectively. Interestingly, circles and ellipses, as well as squares and rectangles, can be regarded as special cases of Lamé curves [1,2], whose mathematical expression is listed as where n is a real number. This equation has been shown to be valid for describing the actual crosssections of tree rings and bamboo shoots [2][3][4][5]. Equation (3) in polar coordinates can be rewritten as where r and ϕ are the polar radius and the angle between the straight line where the polar radius lies and the x-axis, respectively. Gielis proposed a more general polar equation that can reflect more complex natural shapes [1,2]: where n1, n2 and n3 are constants (both ∈ ℝ); positive integer m was introduced to make the curve generate arbitrary polygons (with m angles) consequently enhancing the flexibility of Lamé curves. We refer to Equation (5) as the original Gielis equation (OGE) in the following text for simplicity. OGE has been used to simulate many natural shapes, e.g., diatoms, eggs, cross sections of plants, snowflakes and starfish [1,2]. OGE also has shown its validity in describing several actual natural shapes, e.g., leaf shapes of Hydrocotyle vulgaris L., Polygonum perfoliatum L. and seed planar projections of Ginkgo biloba L. [6,7]. Furthermore, OGE can produce regular, or at least very approximately regular polygons [8,9]. When m = 1, A = B, n1 = n, and n2 = n3 = 1, OGE has a special case: where = ⁄ . This simplified version has been used to describe the actual leaf shapes of 46 bamboo species [2,10,11].
Although OGE is rather flexible in fitting the edge data of many natural shapes, it sometimes fails to describe accurately some symmetrical natural shapes. To further strengthen its flexibility of data fitting, we attempt to build a more generalized equation based on OGE, motivated by the study of starfish, which display a wide diversity of shapes, not only the archetypical shapes. In the Plateau problem of minimal surfaces, one of the constant mean curvature solutions for a soap film is a sphere, but these solutions are for isotropic energy distributions only.
In crystallography, Wulff shapes describe anisotropic distributions of energy, and can take many forms, with their corresponding constant anisotropic mean curvature surfaces [12]. Extending this principle to biological species, starfish can be considered as spheres for specific anisotropic energy distributions. Remarkably, pincushion starfish of the genus Culcita are close to spherical, intermediate between classical spheres and the archetypical shapes of five-armed starfish. Another notable group of starfish are biscuit starfish, almost pentagonal and flat. They belong to the genus Tosia. In order to apply the above methods to these groups, a modification of the original Gielis equation is necessary.

The Generalized Gielis Equation (GGE) and Its Two New Special Cases
OGE can be rewritten as [6] ( ) = 1 cos 4 + sin 4 where = ⁄ , = ⁄ and = 1 ⁄ . Consider the formula inside the parentheses of Equation (7), which we define as follows: We refer to this as the elementary Gielis equation (EGE) for convenience. OGE hypothesizes the existence of a power-law relationship between r and re. We refer to this relationship as the link function, f. As this link function can take on other forms, we use the following more general expression to replace OGE: which we refer to as the generalized Gielis equation (GGE). In actuality, re is the polar radius of the elementary Gielis curve generated by EGE, and r is the polar radius of the generalized Gielis curve generated by GGE. Therefore, OGE is actually a special case of GGE with a power-law link function.
In the current study, we propose the following two candidate forms of the link function: and = exp + ln( ) + (ln( )) If we use the log transformation for the left-and right-hand sides of the above two equations, we obtain, respectively: and where = ln( ) and = ln( ). The first equation is actually a hyperbolic equation, and the second one is a quadratic equation. If we also use the log transformation for both sides of the power-law link function in OGE, a linear equation is obtained. We can express that by letting the coefficient δ2 in Equation (13) be zero. Of course, in nature, there are forms other than the above link functions; however, these other forms also belong to the scope of GGE if there exists a clear functional expression between r and re. Figure 1 provides a simulation example for Equation (10).

Application of the Generalized Gielis Equation
In this section, we mainly illustrate the application of GGE to several starfish species of the families Goniasteridae and Oreasteridae. Culcita and Tosia are the target genera, and Anthenoides tenuis and Stellaster equestris are used as long-armed reference species. Furthermore, we test this on the leaves of four plant species; in particular, we test whether this extension is applicable to elliptical leaves with a broad basis. Table A1 in Appendix A shows the source of the material and species information.
Considering that the five arms of the starfish in Goniasteridae and Oreasteridae are approximately equal, we further simplify Equation (8) to For starfish, we fix m to be 5; for leaves, we fix m to be 1. To measure the goodness of fit, rootmean-square error (RMSE) is used: where and ̂ represent the observed and predicted polar radii of a starfish or a leaf described by GGE; N represents the number of data points on the edge of that starfish or that leaf. In fact, ∑ ( −̂ ) = RSS, where RSS is the residual sum of squares. However, RMSE is not suitable for comparing the goodness of fit among different samples. The reason is that a large object usually has a larger RMSE than a small object even when the fit to the former is just as good. Thus, we use the following adjusted RMSE (RMSEadj) that can reduce the influence of the object's size [13]: where A represents the area of an object of interest. We do not use the coefficient of determination (i.e., r 2 ) as an indicator because it has been considered to be problematic for reflecting the goodness of fit of a nonlinear regression [14,15].
We developed a group of R scripts for extracting planar coordinates of shapes of interests and fit GGE based on R (version 3.62) [16] (see Appendices S1 and S2 in the online supplementary materials). In Appendix S2, we minimize the residual sum of squares (RSS) between the observed and predicted polar radii of a starfish or a leaf described by GGE to estimate the parameters in GGE. The number of data points on an image edge ranged between 1200 and 2700 depending on the original image size and resolution, which is sufficient for describing the profile of the image. Figure 2 shows the original images and the fitted results for the edge data of eight starfish using GGE, and Figure 3 shows the fitted functional relationships (i.e., link functions) between r and re of the eight starfish on a log-log plot. Figure 4 exhibits the fitted leaf shapes and corresponding link functions for the four leaves on a log-log plot. Table A2 in Appendix A tabulates the estimated parameters and indicators of goodness of fit.  Table A1) and fitted generalized Gielis curves. The number in the upper left corner for each black background image panel represents its sample code. The panel below each black background image panel shows the scanned edge (represented by a gray curve) and the fitted edge using GGE (represented by a red curve). The intersection between the blue vertical and horizontal dashed lines represents the polar point; the black inclined dashed line represents the previously used horizontal line of a standard GGE without an angle transformation. In each panel, the small open circles represent the actual values, and the red curve represents the fitted link function based on Equation (12). RMSE values shown here were calculated based on the log-transformed data, while RMSE values in Table A1 were based on the untransformed data of r vs. re. . It proves that the adjusted RMSE is more valid than RMSE in comparing the goodness of fit when there is a large difference in size between any two objects.

Discussion
In Table A1, samples 1, 5 and 12 have larger RMSE values (> 0.10) than the others. For the first two samples, the two starfish have relatively longer arms than the other 7 starfish. RMSE = ∑ ( −̂ ) ⁄ can be considered to be an "average absolute deviation", that is, an average difference, ignoring sign, between the observed and predicted radii. According to Taylor's power law, there is a power-law relationship with an exponent > 0 (usually falling within a range of 1 to 3) between the variance and mean of a non-negative random variable [17,18]. In other words, the variance (and its square root) is an increasing function of the mean. Similarly, the RMSE of radii is positively related to the size of the object and the extent of variation in polar radii. The bigger the object is or the larger the extent of variation in polar radii is, the larger is its RMSE value. That is why samples 1 and 5 have large RMSE values. However, for sample 12, the main reason for its large RMSE value is as a result of the fitting approach. We minimized RSS as the target function of convergence. For the generalized Gielis curve that we used to depict the blade with a power-law function, the polar point was very close to the leaf base (i.e., the connection point of the blade and the petiole) if the leaf is narrow [10,11; also see Figure 5 below]. The ratio of leaf width to length has a big effect on the goodness of fit. A broad leaf shape ensures that the radii for the data points on the edge of a leaf close to the polar point are not too small, which enhances the goodness of fit when RSS is minimized as the target function. However, a narrow leaf shape gives rise to many small radii for the data points on the edge of the leaf near to the polar point, and that results in a large deviation between the actual and predicted radii ( Figure 5). There are many data points that are far away from the polar point for a narrow leaf shape. Minimizing RSS will tend to reduce the deviations for these data points because the radii are larger than those of the data points close to the polar point. Unfortunately, most bamboo leaves are narrow [19]. Thus, the minimization of RSS has resulted in a large deviation for the data points close to the polar point. That is why sample 12 fits the data worse than the other samples. The quadratic function given by Equation (13) with δ2 ≠ 0 did not improve the goodness of fit. Figure 5. Illustration for the comparison between a broad blade (a) and a narrow blade (b). In each panel, the red point represents the polar point; the blue points represent the data points on the edge of the blade; the gray curve represents the blade edge; the segments between the polar point and the data points on the edge represent radii. Each leaf shape was generated by GGE with a power-law relationship (which is equation [13] when δ2 = 0). The horizontal axis of the generalized Gielis curve is rotated counterclockwise by π/4 to conveniently show the image. Here, when δ1 decreases towards 0, the curve approximates a circle with radius exp(δ0) and the polar point becomes the center of this circle at the point (0, 0). In contrast, when δ1 increases towards a large value, the curve approximates a line segment with length exp(δ0) and the polar point approaches the left endpoint of the segment.
For leaves which are flat, the 2D representations are of immediate value to quantify shape and area. For starfish, the 2D representations can serve as one of the two sections to build a 3D starfish. Whether the proposed two functions (i.e., the hyperbolic and quadratic equations) can apply to more shapes is still unknown, meriting further investigation. We believe that other forms of link functions can be found for shapes that cannot be adequately fitted by Equations (12) and (13).

Conclusions
In the present study, we propose a generalized Gielis equation (GGE) by introducing a link function for the polar radius of the elementary Gielis equation (EGE). The original Gielis equation (OGE) can then be regarded as a special case of GGE with a power-law link function between the polar radius of EGE and that of GGE. Although OGE can produce a lot of shapes, the power-law link function has limited validity for describing shapes such as the planar projection of starfish. In that case, we put forward two candidate link functions (a log-hyperbolic function and a log-quadratic function) to make OGE applicable to these shapes. We found that these two functions describe the shapes of the investigated starfish and leaves well, showing that in nature, not all ontogenetic radial growth follows the power-law relationship.
Supplementary Materials: The following are available online at www.mdpi.com/2073-8994/12/4/645/s1, Appendix S1: R script for extracting the planar coordinates of an image, Appendix S2: R script for fitting the edge data using the generalized Gielis equation.
Author Contributions: P.S. and J.G. conceived and designed the experiment together; P.S. and D.A.R. analyzed the data; P.S., D.A.R. and J.G. wrote the manuscript. All authors have read and agreed to the published version of the manuscript.

Conflicts of Interest:
The authors declare no conflict of interest.

Appendix A
There are two tables for tabulating the sample collection information and the fitted results using the generalized Gielis equation, respectively.  In this table, Code represents the sample code (see Table A1 for details); ( , ) represents the estimated planar coordinates of the polar point; represents the estimated angle by which the horizontal line (i.e., the original x-axis) of the generalized Gielis curve was rotated; , , , , , and are estimated parameters in Equations (12) and (13); Sample size represents the number of data points on the edge of an image; Area represents the scanned (actual) area of a starfish or leaf image; RSS is the residual sum of squares; RMSE is the root-mean-square error; RMSEadj is the adjusted root-mean-square error.