Description Usage Arguments Details Value Author(s) Examples
Conjugate complement of a space
1 2 3 4 5 |
object |
An |
u |
A direction vector |
radius |
Radius |
... |
Other arguments |
None yet
A list with elements
u |
A unit vector in the direction 'dir' |
v |
Conjugate direction |
Georges Monette
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function( shape, u , radius = 1) {
# returns 'unit' u and conjugate v
ConjComp <- function( X , Z = diag( nrow(X)) , ip = diag( nrow(X)), tol = 1e-07 ) {
# ConjComp returns a basis for the conjugate complement of the
# conjugate projection of X into span(Z) with respect to inner product with
# matrix ip.
# Note: Z is assumed to be of full column rank but not necessarily X.
xq <- qr(t(Z) %*% ip %*% X, tol = tol)
if ( xq$rank == 0 ) return( Z )
a <- qr.Q( xq, complete = T ) [ ,-(1:xq$rank)]
Z %*% a
}
u <- u / sqrt( sum( u*solve(shape,u))) # 'unit' vector in direction of dir
v <- c(ConjComp( u, diag(2) , solve(shape))) # conjugate
v <- v / sqrt( sum( v * solve( shape, v)))
list(u = radius * u, v= radius * v)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.