Compute points on (the boundary of) an ellipse which is given by elementary geometric parameters.
ellipsePoints(a, b, alpha =0, loc = c(0,0), n =201, keep.ab.order=FALSE)
Arguments
a,b: length of half axes in (x,y) direction. Note that (a,b) is equivalent to (b,a)unless
keep.ab.order=TRUE.
alpha: angle (in degrees) giving the orientation of the ellipse, i.e., the original (x,y)-axis ellipse is rotated by angle.
loc: center (LOCation) of the ellipse.
n: number of points to generate.
keep.ab.order: logical indicating if (a,b) should be considered ordered. When FALSE, as per default, the orientation of the ellipse is solely determined by alpha.
Note that keep.ab.order = TRUE seems a more natural default, but FALSE is there for back-compatibility.
Returns
A numeric matrix of dimension n x 2, each row containing the (x,y) coordinates of a point.