ellipse {RConics} | R Documentation |
Return ellipse points
Description
Return ellipse points. Usefull for ploting ellipses.
Usage
ellipse(
saxes = c(1, 1),
loc = c(0, 0),
theta = 0,
n = 201,
method = c("default", "angle", "distance")
)
Arguments
saxes |
a |
loc |
a |
theta |
the angle of rotation of the elllipse (in radians). |
n |
the number of points returned by the function. |
method |
The method used to return the points: either |
Details
"default"
returns points according to the polar equation;
"angle"
returns points radially equidistant;
"distance"
returns points that are equidistant on the ellipse arc.
Value
A (n \times 2)
matrix whose columns correspond to the Cartesian coordinates of the points lying on the ellipse.
Examples
# Ellipse parameters
saxes <- c(5,2)
loc <- c(0,0)
theta <- pi/4
# Plot
plot(ellipse(saxes, loc, theta, n=500),type="l")
points(ellipse(saxes, loc, theta, n=30),pch=20,col="red")
points(ellipse(saxes, loc, theta, n=30, method="angle"),pch=20,col="blue")
points(ellipse(saxes, loc, theta, n=30, method="distance"),pch=20,col="green")
[Package RConics version 1.1.1 Index]