Introduction
Given five points in the plane, your task is to compute the area of the ellipse passing through these points.
You can assume that exactly one non-degenerate ellipse can be constructed with the given input values.
Rules
Input is 10
integers in any convenient form, corresponding to the x
and y
coordinates of the points. For example, you could take input as a list of 10
integers [x1, y1, x2, y2, ..., x5, y5]
, or as [[x1, y1], [x2, y2], ..., [x5, y5]]
, etc.. You may also handle decimal numbers, but only integers are required.
Output is a representation of the area of the ellipse. This may be some symbolic expression, or a decimal value with at least 8
digits of precision.
This is code-golf, so the shortest answer in bytes wins.
Example Input and Output
Input:
[-2, 3, 2, 5, 5, 3, 4, 0, 1, -3]
Output:
62.15326783788685
A depiction of the ellipse passing through these points:
More examples:
f(60, -92, -31, -10, 78, -19, -27, -35, 91, -37) = 9882.59540465108
f(-9, -4, 7, 7, 10, 1, -7, -10, 0, 7) = 269.5966648188643
f(-3, 2, 0, -5, 4, 0, -4, 1, -1, 2) = 98.54937293879908