Main Content

Create ellipsoid

`[X,Y,Z] = ellipsoid(`

returns the `xc,yc,zc`

,`xr,yr,zr`

)*x*-, *y*-, and
*z*-coordinates of an ellipsoid without drawing it. The returned
ellipsoid has center coordinates at `(xc,yc,zc)`

, semiaxis lengths
`(xr,yr,zr)`

, and consists of 20-by-20 faces.

The function returns the *x*-, *y*-, and
*z*- coordinates as three
`21`

-by-`21`

matrices.

To draw the ellipsoid using the returned coordinates, use the
`surf`

or `mesh`

functions.

`ellipsoid`

generates the data using this equation:

$$\frac{{\left(x-xc\right)}^{2}}{x{r}^{2}}+\frac{{\left(y-yc\right)}^{2}}{y{r}^{2}}+\frac{{\left(z-zc\right)}^{2}}{z{r}^{2}}=1.$$

`ellipsoid(0,0,0,1,1,1)`

is equivalent to a unit sphere.