EllipseEquationFromFivePoints: Ellipse equation from five points

View source: R/Ellipse.R

EllipseEquationFromFivePointsR Documentation

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

Details

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

Value

A named numeric vector.

Examples

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"])

PlaneGeometry documentation built on Aug. 10, 2023, 1:09 a.m.