二次曲線¶

Quadratic curve

Creative Commons License
This work by Jephian Lin is licensed under a Creative Commons Attribution 4.0 International License.

$\newcommand{\trans}{^\top} \newcommand{\adj}{^{\rm adj}} \newcommand{\cof}{^{\rm cof}} \newcommand{\inp}[2]{\left\langle#1,#2\right\rangle} \newcommand{\dunion}{\mathbin{\dot\cup}} \newcommand{\bzero}{\mathbf{0}} \newcommand{\bone}{\mathbf{1}} \newcommand{\ba}{\mathbf{a}} \newcommand{\bb}{\mathbf{b}} \newcommand{\bc}{\mathbf{c}} \newcommand{\bd}{\mathbf{d}} \newcommand{\be}{\mathbf{e}} \newcommand{\bh}{\mathbf{h}} \newcommand{\bp}{\mathbf{p}} \newcommand{\bq}{\mathbf{q}} \newcommand{\br}{\mathbf{r}} \newcommand{\bx}{\mathbf{x}} \newcommand{\by}{\mathbf{y}} \newcommand{\bz}{\mathbf{z}} \newcommand{\bu}{\mathbf{u}} \newcommand{\bv}{\mathbf{v}} \newcommand{\bw}{\mathbf{w}} \newcommand{\tr}{\operatorname{tr}} \newcommand{\nul}{\operatorname{null}} \newcommand{\rank}{\operatorname{rank}} %\newcommand{\ker}{\operatorname{ker}} \newcommand{\range}{\operatorname{range}} \newcommand{\Col}{\operatorname{Col}} \newcommand{\Row}{\operatorname{Row}} \newcommand{\spec}{\operatorname{spec}} \newcommand{\vspan}{\operatorname{span}} \newcommand{\Vol}{\operatorname{Vol}} \newcommand{\sgn}{\operatorname{sgn}} \newcommand{\idmap}{\operatorname{id}} \newcommand{\am}{\operatorname{am}} \newcommand{\gm}{\operatorname{gm}} \newcommand{\mult}{\operatorname{mult}} \newcommand{\iner}{\operatorname{iner}}$

In [ ]:
from lingeo import random_int_list

Main idea¶

Consider an equation of the form

$$ ax^2 + bxy + cy^2 = 1. $$

Then it can be written as

$$ \begin{bmatrix} x & y \end{bmatrix} \begin{bmatrix} a & \frac{b}{2} \\ \frac{b}{2} & c \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 1 \end{bmatrix}. $$

Although an $1\times 1$ matrix is different from a scalar, we often abuse the notation and write

$$ \bx\trans A \bx = 1. $$

Since $A$ is symmetirc, by the spectral theorem,
there is an orthonormal basis $\beta$ of $\mathbb{R}^n$ such that $[f_A]_\beta^\beta = D$ is a diagonal matrix.
By setting $Q$ as the matrix whose columns are vectors in $\beta$,
we get $Q$ is an orthogonal matrix such that $Q\trans AQ = D$ is a diagonal matrix.

We may let $Q\by = \bx$ and $\by = Q\trans\bx$.
This means $\by = [\bx]_\beta$ is the vector representation of $\bx$.

By viewing the equation $\bx\trans A\bx = 1$ from the perspective of $\beta$, we get

$$ \bx\trans A\bx = \by\trans Q\trans A Q\by = \by\trans D\by = 1. $$

It is much easier to describe the solution set of $\by\trans D\by = 1$ since $D$ is diagonal.

Side stories¶

  • conic section

Experiments¶

Exercise 1¶

執行以下程式碼。
令 $\beta = \{\bv_1, \cdots, \bv_n\}$ 為 $Q$ 的各行向量。

Run the code below. Let $\beta = \{\bv_1, \cdots, \bv_n\}$ be the columns of $Q$.

In [ ]:
### code
set_random_seed(0)
print_ans = False

while True:
    theta = choice([pi/6, pi/4, pi/3])
    Q = matrix([
        [cos(theta), -sin(theta)],
        [sin(theta), cos(theta)]
    ])
    l = [4*lam for lam in random_int_list(2, 3)]
    D = diagonal_matrix(l)
    A = Q * D * Q.transpose()
    if A[0,1] != 0 and 0 not in l:
        break
        
x,y = var("x y")
eqn = (A[0,0]*x^2 + 2*A[0,1]*x*y + A[1,1]*y^2 == 1)

pretty_print(eqn)
pretty_print(LatexExpr("Q ="), Q)

if print_ans:
    pretty_print(LatexExpr("A ="), A)
    pretty_print(LatexExpr("D ="), D)
    if l[0] < 0 and l[1] < 0:
        print("No solution.")
    if l[0] * l[1] < 0:
        print("Hyperbola counterclockwisely rotated in angle:")
        pretty_print(theta)
        implicit_plot(eqn, xrange=(-1,1), yrange=(-1,1)).show()
    if l[0] > 0 and l[1] > 0:
        print("Ellipse counterclockwisely rotated in angle:")
        pretty_print(theta)
        implicit_plot(eqn, xrange=(-1,1), yrange=(-1,1)).show()
Exercise 1(a)¶

找一個 $2\times 2$ 矩陣 $A$,將上述方程式寫成

$$ \begin{bmatrix} x & y \end{bmatrix} A \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 1 \end{bmatrix}. $$

Find a $2\times 2$ matrix $A$ so that the equation above is equivalent to

$$ \begin{bmatrix} x & y \end{bmatrix} A \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 1 \end{bmatrix}. $$
Exercise 1(b)¶

計算 $D = Q^{-1}AQ$ 並說明同一個解集合用 $\beta$ 基底觀察出的方程式。

Calculate $D = Q^{-1}AQ$ and find the equation with the solution set under the perspective of $\beta$.

Exercise 1(c)¶

描述這個方程式的解集合的形狀。

Describe the shape of the solution set.

Exercises¶

Exercise 2¶

描述以下方程式的解集合的形狀。

Describe the shape of the solution set of the given equations.

Exercise 2(a)¶

已知

$$ \begin{bmatrix} 4 & 0 \\ 0 & 6 \end{bmatrix} = \begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{bmatrix}^{-1} \begin{bmatrix} 5 & -1 \\ -1 & 5 \end{bmatrix} \begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{bmatrix}. $$

考慮方程式 $5x^2 + 5y^2 - 2xy = 1$。

It is known that

$$ \begin{bmatrix} 4 & 0 \\ 0 & 6 \end{bmatrix} = \begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{bmatrix}^{-1} \begin{bmatrix} 5 & -1 \\ -1 & 5 \end{bmatrix} \begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{bmatrix}. $$

Consider the equation $5x^2 + 5y^2 - 2xy = 1$.

Exercise 2(b)¶

已知

$$ \begin{bmatrix} 4 & 0 \\ 0 & -6 \end{bmatrix} = \begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{bmatrix}^{-1} \begin{bmatrix} -1 & 5 \\ 5 & -1 \end{bmatrix} \begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{bmatrix}. $$

考慮方程式 $-x^2 -y^2 + 10xy = 1$。

It is known that

$$ \begin{bmatrix} 4 & 0 \\ 0 & -6 \end{bmatrix} = \begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{bmatrix}^{-1} \begin{bmatrix} -1 & 5 \\ 5 & -1 \end{bmatrix} \begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{bmatrix}. $$

Consider the equation $-x^2 -y^2 + 10xy = 1$.

Exercise 2(c)¶

已知

$$ \begin{bmatrix} 2 & 0 \\ 0 & 0 \end{bmatrix} = \begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{bmatrix}^{-1} \begin{bmatrix} 1 & 1 \\ 1 & 1 \end{bmatrix} \begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{bmatrix}. $$

考慮方程式 $x^2 + y^2 + 2xy = 1$。

It is known that

$$ \begin{bmatrix} 2 & 0 \\ 0 & 0 \end{bmatrix} = \begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{bmatrix}^{-1} \begin{bmatrix} 1 & 1 \\ 1 & 1 \end{bmatrix} \begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{bmatrix}. $$

Consider the equation $x^2 + y^2 + 2xy = 1$.

Exercise 3¶

描述以下方程式的解集合的形狀。

Describe the shape of the solution set of the given equations.

Exercise 3(a)¶

已知

$$ \begin{bmatrix} 3 & 0 & 0 \\ 0 & 4 & 0 \\ 0 & 0 & 6 \end{bmatrix} = \begin{bmatrix} \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\ \frac{1}{\sqrt{3}} & -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\ \frac{1}{\sqrt{3}} & 0 & -\frac{2}{\sqrt{6}} \end{bmatrix}^{-1} \begin{bmatrix} 4 & 0 & -1 \\ 0 & 4 & -1 \\ -1 & -1 & 5 \end{bmatrix} \begin{bmatrix} \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\ \frac{1}{\sqrt{3}} & -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\ \frac{1}{\sqrt{3}} & 0 & -\frac{2}{\sqrt{6}} \end{bmatrix}. $$

考慮方程式 $4x^2 + 4y^2 + 5z^2 - 2xz - 2yz = 1$。

It is known that

$$ \begin{bmatrix} 3 & 0 & 0 \\ 0 & 4 & 0 \\ 0 & 0 & 6 \end{bmatrix} = \begin{bmatrix} \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\ \frac{1}{\sqrt{3}} & -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\ \frac{1}{\sqrt{3}} & 0 & -\frac{2}{\sqrt{6}} \end{bmatrix}^{-1} \begin{bmatrix} 4 & 0 & -1 \\ 0 & 4 & -1 \\ -1 & -1 & 5 \end{bmatrix} \begin{bmatrix} \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\ \frac{1}{\sqrt{3}} & -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\ \frac{1}{\sqrt{3}} & 0 & -\frac{2}{\sqrt{6}} \end{bmatrix}. $$

Consider the equation $4x^2 + 4y^2 + 5z^2 - 2xz - 2yz = 1$.

Exercise 3(b)¶

已知

$$ \begin{bmatrix} 3 & 0 & 0 \\ 0 & 4 & 0 \\ 0 & 0 & -6 \end{bmatrix} = \begin{bmatrix} \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\ \frac{1}{\sqrt{3}} & -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\ \frac{1}{\sqrt{3}} & 0 & -\frac{2}{\sqrt{6}} \end{bmatrix}^{-1} \begin{bmatrix} 2 & -2 & 3 \\ -2 & 2 & 3 \\ 3 & 3 & -3 \end{bmatrix} \begin{bmatrix} \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\ \frac{1}{\sqrt{3}} & -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\ \frac{1}{\sqrt{3}} & 0 & -\frac{2}{\sqrt{6}} \end{bmatrix}. $$

考慮方程式 $2x^2 + 2y^2 - 3z^2 - 4xy + 6xz + 6yz = 1$。

It is known that

$$ \begin{bmatrix} 3 & 0 & 0 \\ 0 & 4 & 0 \\ 0 & 0 & -6 \end{bmatrix} = \begin{bmatrix} \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\ \frac{1}{\sqrt{3}} & -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\ \frac{1}{\sqrt{3}} & 0 & -\frac{2}{\sqrt{6}} \end{bmatrix}^{-1} \begin{bmatrix} 2 & -2 & 3 \\ -2 & 2 & 3 \\ 3 & 3 & -3 \end{bmatrix} \begin{bmatrix} \frac{1}{\sqrt{3}} & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\ \frac{1}{\sqrt{3}} & -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{6}} \\ \frac{1}{\sqrt{3}} & 0 & -\frac{2}{\sqrt{6}} \end{bmatrix}. $$

Consider the equation $2x^2 + 2y^2 - 3z^2 - 4xy + 6xz + 6yz = 1$.

Exercise 3(c)¶

說明方程式 $2x^2 + 2y^2 - 3 - 4xy + 6x + 6y = 0$ 的解集合是一個三維圓椎和一個平面的交集。

Show that the solution set of $2x^2 + 2y^2 - 3 - 4xy + 6x + 6y = 0$ is the intersection of the surface of a cone and a plane.

Exercise 4¶

令 $D$ 為一對角矩陣,
$n_+$、$n_-$、$n_0$ 分別為 $D$ 的對角線上正的、負的、為零的元素的個數。 考慮

$$ \begin{bmatrix} x & y \end{bmatrix} D \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 1 \end{bmatrix} $$

的解集合。 完成以下表格。

n+ n- n0 shape
2 0 0 橢圓
0 2 0
0 0 2
1 1 0
1 0 1
0 1 1

Let $D$ be a diagonal matrix, $n_+$, $n_-$, $n_0$ are the number of positive, negative, zero entries on the diagonal of $D$. Consider the solution set of

$$ \begin{bmatrix} x & y \end{bmatrix} D \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 1 \end{bmatrix}. $$

Then complete the table below.

n+ n- n0 shape
2 0 0 橢圓
0 2 0
0 0 2
1 1 0
1 0 1
0 1 1