Linear transformation of a generalized ellipsoid, including projections to subspaces.
Details
The matrix A
can be non-singular, for a standard linear
transformation, or singular, for a projection to a subspace.
Note
This implementation should be changed so that it provides an S3 method
for class "gell"
objects for which it was intended.
Examples
(zplane <- gell(span = diag(3)[,1:2])) # a plane
#> $center
#> [1] 0 0 0
#>
#> $u
#> [,1] [,2] [,3]
#> [1,] 1 0 0
#> [2,] 0 1 0
#> [3,] 0 0 1
#>
#> $d
#> [1] Inf Inf 0
#>
#> attr(,"class")
#> [1] "gell"
dual(zplane) # orthogonal line
#> $center
#> [1] 0 0 0
#>
#> $u
#> [,1] [,2] [,3]
#> [1,] 0 0 1
#> [2,] 0 1 0
#> [3,] 1 0 0
#>
#> $d
#> [1] Inf 0 0
#>
#> attr(,"class")
#> [1] "gell"
(zplane2 <- gmult( cbind( c(1,1,1), c(1,-1,0), c(1,0,-1)), zplane))
#> $center
#> [1] 0 0 0
#>
#> $u
#> [,1] [,2] [,3]
#> [1,] -0.8040001 0.4323391 -0.4082483
#> [2,] -0.2628040 -0.8742239 -0.4082483
#> [3,] -0.5334021 -0.2209424 0.8164966
#>
#> $d
#> [1] Inf Inf 0
#>
#> attr(,"class")
#> [1] "gell"
# correctly wipes out one dimension
(zplane3 <- gmult( cbind( c(1,0,0), c(1,0,0), c(0,0,1)), zplane))
#> $center
#> [1] 0 0 0
#>
#> $u
#> [,1] [,2] [,3]
#> [1,] 1 0 0
#> [2,] 0 1 0
#> [3,] 0 0 1
#>
#> $d
#> [1] Inf 0 0
#>
#> attr(,"class")
#> [1] "gell"