Hyperbola | R Documentation |
A hyperbola is given by two intersecting asymptotes, named
L1
and L2
, and a point on this hyperbola, named M
.
L1
get or set the asymptote L1
L2
get or set the asymptote L2
M
get or set the point M
new()
Create a new Hyperbola
object.
Hyperbola$new(L1, L2, M)
L1, L2
two intersecting lines given as Line
objects, the
asymptotes
M
a point on the hyperbola
A new Hyperbola
object.
center()
Center of the hyperbola.
Hyperbola$center()
The center of the hyperbola, i.e. the point where the two asymptotes meet each other.
OAB()
Parametric equation O \pm cosh(t) A + sinh(t) B
representing the hyperbola.
Hyperbola$OAB()
The point O
and the two vectors A
and B
in a list.
L1 <- LineFromInterceptAndSlope(0, 2) L2 <- LineFromInterceptAndSlope(-2, -0.5) M <- c(4, 3) hyperbola <- Hyperbola$new(L1, L2, M) hyperbola$OAB()
vertices()
Vertices of the hyperbola.
Hyperbola$vertices()
The two vertices V1
and V2
in a list.
abce()
The numbers a
(semi-major axis, i.e. distance
from center to vertex),
b
(semi-minor axis),
c
(linear eccentricity)
and e
(eccentricity)
associated to the hyperbola.
Hyperbola$abce()
The four numbers a
, b
, c
and e
in a list.
foci()
Foci of the hyperbola.
Hyperbola$foci()
The two foci F1
and F2
in a list.
plot()
Plot hyperbola.
Hyperbola$plot(add = FALSE, ...)
add
Boolean, whether to add this plot to the current plot
...
named arguments passed to lines
Nothing, called for plotting.
L1 <- LineFromInterceptAndSlope(0, 2) L2 <- LineFromInterceptAndSlope(-2, -0.5) M <- c(4, 3) hyperbola <- Hyperbola$new(L1, L2, M) plot(hyperbola, lwd = 2) points(t(M), pch = 19, col = "blue") O <- hyperbola$center() points(t(O), pch = 19) draw(L1, col = "red") draw(L2, col = "red") vertices <- hyperbola$vertices() points(rbind(vertices$V1, vertices$V2), pch = 19) majorAxis <- Line$new(vertices$V1, vertices$V2) draw(majorAxis, lty = "dashed") foci <- hyperbola$foci() points(rbind(foci$F1, foci$F2), pch = 19, col = "green")
includes()
Whether a point belongs to the hyperbola.
Hyperbola$includes(P)
P
a point
A Boolean value.
L1 <- LineFromInterceptAndSlope(0, 2) L2 <- LineFromInterceptAndSlope(-2, -0.5) M <- c(4, 3) hyperbola <- Hyperbola$new(L1, L2, M) hyperbola$includes(M)
equation()
Implicit quadratic equation of the hyperbola Axxx2 + 2Axyxy + Ayyy2 + 2Bxx + 2Byy + C = 0
Hyperbola$equation()
The coefficients of the equation in a named list.
L1 <- LineFromInterceptAndSlope(0, 2) L2 <- LineFromInterceptAndSlope(-2, -0.5) M <- c(4, 3) hyperbola <- Hyperbola$new(L1, L2, M) eq <- hyperbola$equation() x <- M[1]; y <- M[2] with(eq, Axx*x^2 + 2*Axy*x*y + Ayy*y^2 + 2*Bx*x + 2*By*y + C) V1 <- hyperbola$vertices()$V1 x <- V1[1]; y <- V1[2] with(eq, Axx*x^2 + 2*Axy*x*y + Ayy*y^2 + 2*Bx*x + 2*By*y + C)
clone()
The objects of this class are cloneable with this method.
Hyperbola$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------
## Method `Hyperbola$OAB`
## ------------------------------------------------
L1 <- LineFromInterceptAndSlope(0, 2)
L2 <- LineFromInterceptAndSlope(-2, -0.5)
M <- c(4, 3)
hyperbola <- Hyperbola$new(L1, L2, M)
hyperbola$OAB()
## ------------------------------------------------
## Method `Hyperbola$plot`
## ------------------------------------------------
L1 <- LineFromInterceptAndSlope(0, 2)
L2 <- LineFromInterceptAndSlope(-2, -0.5)
M <- c(4, 3)
hyperbola <- Hyperbola$new(L1, L2, M)
plot(hyperbola, lwd = 2)
points(t(M), pch = 19, col = "blue")
O <- hyperbola$center()
points(t(O), pch = 19)
draw(L1, col = "red")
draw(L2, col = "red")
vertices <- hyperbola$vertices()
points(rbind(vertices$V1, vertices$V2), pch = 19)
majorAxis <- Line$new(vertices$V1, vertices$V2)
draw(majorAxis, lty = "dashed")
foci <- hyperbola$foci()
points(rbind(foci$F1, foci$F2), pch = 19, col = "green")
## ------------------------------------------------
## Method `Hyperbola$includes`
## ------------------------------------------------
L1 <- LineFromInterceptAndSlope(0, 2)
L2 <- LineFromInterceptAndSlope(-2, -0.5)
M <- c(4, 3)
hyperbola <- Hyperbola$new(L1, L2, M)
hyperbola$includes(M)
## ------------------------------------------------
## Method `Hyperbola$equation`
## ------------------------------------------------
L1 <- LineFromInterceptAndSlope(0, 2)
L2 <- LineFromInterceptAndSlope(-2, -0.5)
M <- c(4, 3)
hyperbola <- Hyperbola$new(L1, L2, M)
eq <- hyperbola$equation()
x <- M[1]; y <- M[2]
with(eq, Axx*x^2 + 2*Axy*x*y + Ayy*y^2 + 2*Bx*x + 2*By*y + C)
V1 <- hyperbola$vertices()$V1
x <- V1[1]; y <- V1[2]
with(eq, Axx*x^2 + 2*Axy*x*y + Ayy*y^2 + 2*Bx*x + 2*By*y + C)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.