# make an ellipse and derotate it
parGr <- c(-2.3,4.2,5,3,pi/4)
xe <-seq(-8,9,by=.05)
elipGr <- createConic(xe, parGr, 'e')
plot(elipGr, t= 'l', asp = TRUE)
# convert to ABCDEF form
parAr <- GtoA(parGr,'e')
elipAr <- createConic(xe,parAr$parA)
points(elipAr,pch='.',col='red')
# remove rotation angle
parAd <- derotateA(parAr$parA)
# returns theta = pi/4, how much the ellipse had been rotated by
elipAd <-createConic(xe,parAd$parA)
lines(elipAd)
# rotate back
parAdr <- rotateA(parAd$parA, parAd$theta)
elipAdr <-createConic(xe,parAdr$parA)
lines(elipAdr,lty=3, lwd = 3, col='green')
Run the code above in your browser using DataLab