View source: R/secant_intersections.R
secant_intersections | R Documentation |
The circle is centered a (0, 0) and has radius r, the line is given in slope-intercept from.
secant_intersections(a, b, r, verbose = FALSE)
a |
The secant's intercept. |
b |
The secant's slope. |
r |
The circle's radius |
verbose |
Be verbose? |
A matrix of x und y values. For a tangent, both rows are identical,
for a straight line missing the circle, a matrix of NA
.
secant_intersections(a = 0, b = 1, r = 2)
# A tangent
secant_intersections(a = 2, b = 0, r = 2, verbose = TRUE)
# Missing the circle
secant_intersections(a = 3, b = 0, r = 2)
# Creating a circle boundary approximation
plot(0, 0, col = "red", pch = "+",
xlim = c(-2, 2),
ylim = c(-2, 2))
for (i in seq(-1, 1, by = 0.01)) {
points(secant_intersections(Inf, i, 1), pch = "+")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.