**ellipse**,
a MATLAB code which
carries out geometric calculations for ellipses and ellipsoids, including
area, distance to a point, eccentricity, perimeter, points along the
perimeter, random sampling, conversion between standard and quadratic forms.

The computer code and data files described and made available on this web page are distributed under the MIT license

**ellipse** is available in
a C version and
a C++ version and
a Fortran90 version and
a MATLAB version and
an Octave version and
a Python version.

geometry, a MATLAB code which performs geometric calculations in 2, 3 and M dimensional space, including the computation of angles, areas, containment, distances, intersections, lengths, and volumes.

hypersphere, a MATLAB code which carries out various operations for a D-dimensional hypersphere, including converting between Cartesian and spherical coordinates, stereographic projection, sampling the surface of the sphere, and computing the surface area and volume.

polygon, a MATLAB code which carries out geometric calculations on polygons, including angles, area, centroid, containment of a point, diameter, integrals of monomials, convexity, distance to a point.

quadrilateral, a MATLAB code which carries out geometric calculations on quadrilaterals, including angles, area, distances, nearest point, point containment, perimeter, and random generation.

random_data, a MATLAB code which uses a random number generator (RNG) to sample points corresponding to various probability density functions (PDF), spatial dimensions, and geometries, including the annulus, circle, ellipse, ellipsoid, hypercube, hypersphere, simplex, tetrahedron and triangle.

tetrahedron, a MATLAB code which carries out geometric calculations involving a general tetrahedron, including solid and facial angles, face areas, point containment, distances to a point, circumsphere and insphere, measures of shape quality, centroid, barycentric coordinates, edges and edge lengths, random sampling, and volumes.

- ellipse_area1.m, returns the area of an ellipse x'*A*x=r^2;
- ellipse_area2.m, returns the area of an ellipse ax^2+bxy+cy^2=d;
- ellipse_area3.m, returns the area of an ellipse (x/r1)^2+(y/r2)^2=1;
- ellipse_aspect_ratio.m, returns the aspect ratio of an ellipse (x/a)^2+(y/b)^2=1;
- ellipse_ecentricity.m, returns the eccentricity of an ellipse (x/a)^2+(y/b)^2=1;
- ellipse_flattening.m, returns the flattening of an ellipse (x/a)^2+(y/b)^2=1;
- ellipse_perimeter.m, returns the perimeter of an ellipse (x/a)^2+(y/b)^2=1;
- ellipse_point_dist_2d.m, returns the distance to an ellipse in 2D;
- ellipse_point_near_2d.m, returns the nearest point on an ellipse in 2D;
- ellipse_points_2d.m, returns points on an ellipse in 2D;
- ellipse_points_arc_2d.m, returns points on an elliptical arc;
- ellipse_quadratic_to_standard.m, converts the formula for an ellipse from quadratic to standard form.
- ellipse_standard_to_quadratic.m, converts the formula for an ellipse from standard to quadratic form.
- ellipsoid_area.m, returns the surface area of an ellipsoid.
- elliptic_inc_em.m evaluates the incomplete elliptic integral E(PHI,M).
- elliptic_inc_fm.m evaluates the incomplete elliptic integral F(PHI,M).
- r8_modp.m, returns the positive remainder of R8 division;
- r8_sign.m, returns the sign of an R8;
- rd.m computes an incomplete elliptic integral of the second kind, RD(X,Y,Z).
- rf.m computes an incomplete elliptic integral of the first kind, RF(X,Y,Z).