wrangle_ellipse: Ellipse Wrangeler

Description Usage Arguments Details Value Examples

View source: R/wrangle_ellipse.R

Description

wrangle_ellipse is used to wrangle one or more ellipses from one parametrization to another.

Usage

1
wrangle_ellipse(ell, out_params = c("c", "P", "r"))

Arguments

ell

a list of (non degenerate) ellipses to be wrangled. An ellipse is a named list and each entry corresponds to a parameter. To ensure all out_params can be calculated one of the parametrizations listed below in the description must be specified. Some out_params do not require a fully parametrized ellipse and so partially specified ellipses can be used.

out_params

a vector of names of the output parameters. A list of possible parameters is given below in the details.

Details

Takes ellipse parameters and and calculates the wanted out_params. A parameterization is a named list, where each named entry is a parameter. The following parameters are accepted both input and output:

An ellipse E may be fully parameterized using the above parameters in the following ways:

E = { x ∈ Rp : (x - c)T P (x - c) ≤ r }
E = { x ∈ Rp : (x - c)T S-1 (x - c) ≤ r }
E = { x ∈ Rp : (x - c)T LLT (x - c) ≤ r }
E = { x ∈ Rp : (x - c)T UD2UT (x - c) ≤ r }
E = { x ∈ Rp : || LT(x - c) ||2 ≤ r }
E = { x ∈ Rp : || DUT(x - c) ||2 ≤ r }
E = { x ∈ Rp : c + L-Tw, ||w|| ≤ r }
E = { x ∈ Rp : c + UD-1w, ||w|| ≤ r }

To ensure that all of the above parameters can be calculated it is advised (but in some cases not needed) that the input ellipses are fully parameterized.

Value

A list of wrangled ellipses. The wrangled ellipses are now given by the out_params.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# two dimensional unite ball
e2d <- list(c = c(0,0), S = matrix(c(1,0,0,1), ncol = 2), r = 1)

# three dimensional ellipse
e3d <- list(c = c(3,2,1), P = matrix(c(3,1,2,1,5,0,2,0,2), ncol = 3))

f1 <- wrangle_ellipse(e2d) # (c,P,r) parameterization
f2 <- wrangle_ellipse(e2d, out_params = c("c", "e", "U", "r"))
f3 <- wrangle_ellipse(list("ellipse1" = e2d, "ellipse2" = e3d),
                      c("n", "c", "U", "D"))

fellov documentation built on Feb. 21, 2020, 5:07 p.m.