Learn R Programming

PlaneGeometry (version 1.1.0)

EllipseEquationFromFivePoints: Ellipse equation from five points

Description

The coefficients of the implicit equation of an ellipse from five points on this ellipse.

Usage

EllipseEquationFromFivePoints(P1, P2, P3, P4, P5)

Arguments

P1, P2, P3, P4, P5

the five points

Value

A named numeric vector.

Details

The implicit equation of the ellipse is Ax<U+00B2> + Bxy + Cy<U+00B2> + Dx + Ey + F = 0. This function returns A, B, C, D, E and F.

Examples

Run this code
# NOT RUN {
ell <- Ellipse$new(c(2,3), 5, 4, 30)
set.seed(666)
pts <- ell$randomPoints(5, "on")
cf1 <- EllipseEquationFromFivePoints(pts[1,],pts[2,],pts[3,],pts[4,],pts[5,])
cf2 <- ell$equation() # should be the same up to a multiplicative factor
all.equal(cf1/cf1["F"], cf2/cf2["F"])
# }

Run the code above in your browser using DataLab