f_circle | R Documentation |
theta
Circle function with angle argument theta
such that
sign(dir) * theta + theta0 = 0
corresponds to c(x0 + r, y0)
f_circle(x0 = 0, y0 = 0, r = 1, theta0 = 0, dir = 1)
x0 |
A numeric value. The x-axis value of the circle center. |
y0 |
A numeric value. The y-axis value of the circle center. |
r |
A numeric value. The circle radius. |
theta0 |
A numeric value. The (anti-clockwise) angle/rotation of the starting point of the circle. |
dir |
A numeric value, interpreted as either
|
thetas <- seq(0, 2 * pi, length = 200)
# circle with radius 1 and center at 0/0
circle1 <- f_circle()
plot(circle1(thetas), asp = 1, type = "l")
points(0, 0, pch = 4)
# circle with radius 0.1 and center at 0.3/0.3
lines(f_circle(0.3, 0.3, 0.1)(thetas))
# circle with radius 0.1 and center at -0.3/0.3
lines(f_circle(-0.3, 0.3, 0.1)(thetas))
# semi-circle with radius 0.5 and center at 0/0
lines(f_circle(0, 0, 0.5, dir = -1)(seq(0, pi, length = 200)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.