Displaying 1 result from an estimated 1 matches for "rotmatrix".
2003 May 30
2
Creating a vector class
...ector')
First questions: is this the way to say that orientations behave as
vectors? Do I need to say that? Should I say that?
One representation is as an SO(3) matrix (i.e. a 3x3 matrix with
determinant 1). I have a descendant class that stores these in a
3 x 3 x n array:
setClass('rotmatrix', representation(x = 'array'))
setIs('rotmatrix','orientation')
rotmatrix <- function(a) {
d <- dim(a)
if (length(d) < 3) d <- c(d,1)
a <- array(a, d)
stopifnot(dim(a)[1] == 3, dim(a)[2] == 3)
new('rotmatrix', x = a)
}
Other r...