ellipse fuction (hlaxa=1,hlaxb=1,theta=0, xc=0,yc=0,newplot=TRUE,npoint=100) { a<- seq(0,2pi,length=npoints+1) x<- hlaxacos(a) y<- hlaxbsin(a) alpha<- pi/3 rad<- sqrt(x^2+y^2) xp<- radcos(alpha+theta)+xc yp<- rad*sin(alpha+theta)+yc if(newplot) plot(xp,yp,type="1",...) else lines(xp,yp,...) invisible() }
I tried to draw ellipse using ellipse package but it did't work. it say unexpected symbol in ellipse fuction.
ellipse fuction (hlaxa=1,hlaxb=1,theta=0, xc=0,yc=0,newplot=TRUE,npoint=100) { a<- seq(0,2pi,length=npoints+1) x<- hlaxacos(a) y<- hlaxbsin(a) alpha<- pi/3 rad<- sqrt(x^2+y^2) xp<- radcos(alpha+theta)+xc yp<- rad*sin(alpha+theta)+yc if(newplot) plot(xp,yp,type="1",...) else lines(xp,yp,...) invisible() }
it happen in such ways.