logo

Quadratic Curve 📂Geometry

Quadratic Curve

Definition

Plane curves of the following types that can be expressed by a quadratic equation in two variables are called conic sections.

Description

The Circle is a special case of the ellipse, so it is generally not mentioned separately when referring to conic sections.

Parabola

parabola

Ellipse

ellipse

Hyperbola

hyperbola

Code

The following is Julia code for drawing conic sections.

using Plots
default(framestyle = :origin, color = :lightgray, lw = 2, legend = :none, ticks = [], size = [400, 400], aspect_ratio = 1)
t = range(-2, 2, length=100)

plot(t.^2, 2t)
vline!([-1], linestyle=:dash)
scatter!([1], [0], color = :black)
png("parabola.png")

θ = range(0, 2π, length=100)
plot(sqrt(2)*cos.(θ), sin.(θ))
scatter!([1, -1], [0, 0], color = :black)
png("ellipse.png")

plot()
plot!(cosh.(t), sinh.(t))
plot!(-cosh.(t), sinh.(t))
scatter!([sqrt(2), -sqrt(2)], [0, 0], color = :black)
png("hyperbola.png")