关于坐标变换
****# 关于坐标变换
我们已经知道,一条圆锥曲线可以写成
\[A x ^ 2 + B y ^ 2 + C x y + D x + E y + F = 0
\]
或者花哨一点
\[F = { \begin{bmatrix} x \\ y \\ z \end{bmatrix} } ^ T \begin{bmatrix} A & \frac{ C }{ 2 } & \frac{ D }{ 2 } \\ \frac{ C }{ 2 } & B & \frac{ E }{ 2 } \\ \frac{ D }{ 2 } & \frac{ E }{ 2 } & F \end{bmatrix} \begin{bmatrix} x \\ y \\ z \end{bmatrix} = 0
\]
简记为
\[F = r ^ T \eta \mspace{ 2mu } r
\]
在标况下(bushi),有
\[F = { \begin{bmatrix} x \\ y \\ z \end{bmatrix} } ^ T \begin{bmatrix} A _ 0 & 0 & 0 \\ 0 & B _ 0 & 0 \\ 0 & 0 & F _ 0\end{bmatrix} \begin{bmatrix} x \\ y \\ z \end{bmatrix} = 0
\]
\[\Rightarrow F = r ^ T \eta _ 0 r
\]
这仅仅是对于双曲线和椭圆,抛物线比较特殊。
又知道,平移坐标变换
\[\begin{bmatrix} x ^ \prime \\ y ^ \prime \\ 1 \end{bmatrix} = \begin{bmatrix} 1 & 0 & \delta _ x \\ 0 & 1 & \delta _ y \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} x \\ y \\ 1 \end{bmatrix}
\]
旋转坐标变换
\[\begin{bmatrix} x ^ \prime \\ y ^ \prime \\ 1 \end{bmatrix} = \begin{bmatrix} \cos \theta & - \sin \theta & 0 \\ \sin \theta & \cos \theta & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} x \\ y \\ 1 \end{bmatrix}
\]
故而在平面直角坐标系,任意一种坐标变换可以写成
\[\Lambda = \begin{bmatrix} \cos \theta & - \sin \theta & \delta _ x \cos \theta - \delta _ y \sin \theta \\ \sin \theta & \cos \theta & \delta _ x \sin \theta + \delta _ y \cos \theta \\ 0 & 0 & 1 \end{bmatrix}
\]
对一个正椭圆/抛物线,进行一次变换,有
\[F = r _ 0 ^ T \eta _ 0 r _ 0 = ( \Lambda r ) ^ T \eta _ 0 ( \Lambda r ) = r ^ T ( \Lambda ^ T \eta _ 0 \Lambda ) r
\]
\[\Rightarrow \eta = \Lambda ^ T \eta _ 0 \Lambda
\]
展开写就是
\[\begin{bmatrix} A & \frac{ C }{ 2 } & \frac{ D }{ 2 } \\ \frac{ C }{ 2 } & B & \frac{ E }{ 2 } \\ \frac{ D }{ 2 } & \frac{ E }{ 2 } & F \end{bmatrix} = \begin{bmatrix} A _ 0 \cos ^ 2 \theta + B _ 0 \sin ^ 2 \theta & ( B _ 0 - A _ 0 ) \sin \theta \cos \theta & A _ 0 \cos \theta ( \delta _ x \cos \theta - \delta _ y \sin \theta ) + B _ 0 \sin \theta ( \delta _ x \sin \theta + \delta _ y \cos \theta ) \\ ( B _ 0 - A _ 0 ) \sin \theta \cos \theta & A _ 0 \sin ^ 2 \theta + B _ 0 \cos ^ 2 \theta & - A _ 0 \sin \theta ( \delta _ x \cos \theta - \delta _ y \sin \theta ) + B _ 0 \cos \theta ( \delta _ x \sin \theta + \delta _ y \cos \theta ) \\ A _ 0 \cos \theta ( \delta _ x \cos \theta - \delta _ y \sin \theta ) + B _ 0 \sin \theta ( \delta _ x \sin \theta + \delta _ y \cos \theta ) & - A _ 0 \sin \theta ( \delta _ x \cos \theta - \delta _ y \sin \theta ) + B _ 0 \cos \theta ( \delta _ x \sin \theta + \delta _ y \cos \theta ) & A _ 0 ( \delta _ x \cos \theta - \delta y \sin \theta ) ^ 2 + B _ 0 ( \delta _ x \sin \theta + \delta _ y \cos \theta ) ^ 2 + F _ 0 \end{bmatrix}
\]
真是十分的美观啊。
写成方程组的形式
\[A = A _ 0 \cos ^ 2 \theta + B _ 0 \sin ^ 2 \theta
\]
\[B = A _ 0 \sin ^ 2 \theta + B _ 0 \cos ^ 2 \theta
\]
\[\frac{ C }{ 2 } = ( B _ 0 - A _ 0) \sin \theta \cos \theta
\]
\[\frac{ D }{ 2 } = A _ 0 \cos \theta ( \delta _ x \cos \theta - \delta _ y \sin \theta ) + B _ 0 \sin \theta ( \delta _ x \sin \theta + \delta _ y \cos \theta )
\]
\[\frac{ E }{ 2 } = - A _ 0 \sin \theta ( \delta _ x \cos \theta - \delta _ y \sin \theta ) + B _ 0 \cos \theta ( \delta _ x \sin \theta + \delta _ y \cos \theta )
\]
\[F = A _ 0 ( \delta _ x \cos \theta - \delta y \sin \theta ) ^ 2 + B _ 0 ( \delta _ x \sin \theta + \delta _ y \cos \theta ) ^ 2 + F _ 0
\]
采用zzx法解这个方程(找zzx解这个方程的办法)
\[\tan 2 \theta = \frac{ C }{ B - A }
\]
\[\Rightarrow \tan \theta = \sqrt{ \frac{ \sqrt{ ( B - A ) ^ 2 + C ^ 2 } - ( B - A ) }{ \sqrt{ ( B - A ) ^ 2 + C ^ 2 } + ( B - A ) } }
\]
\[\Rightarrow \sin \theta = \sqrt{ \frac{ \sqrt{ ( B - A ) ^ 2 + C ^ { \ 2 } } - ( B - A ) }{ 2 \sqrt{ ( B - A ) ^ 2 + C ^ 2 } } }
\]
\[\cos \theta = \sqrt{ \frac{ \sqrt{ ( B - A ) ^ 2 + C ^ 2 } + ( B - A ) }{ 2 \sqrt{ ( B - A ) ^ 2 + C ^ 2 } } }
\]
\[A _ 0 = \frac{ A _ 0 \cos ^ 2 \theta - B _ 0 \sin ^ 2 \theta }{ \cos 2 \theta } = \frac{ 1 }{ 2 } \left [ ( A + B ) - \sqrt{ ( B - A ) ^ 2 + C ^ 2 } \mspace{ 2mu } \right ]
\]
\[B _ 0 = \frac{ B _ 0 \cos ^ 2 \theta - A _ 0 \sin ^ 2 \theta }{ \cos 2 \theta } = \frac{ 1 }{ 2 } \left [ ( A + B ) + \sqrt{ ( B - A ) ^ 2 + C ^ 2 } \mspace{ 2mu } \right ]
\]
\[\delta _ x = \frac{ ( D \cos \theta - E \sin \theta ) \cos \theta }{ 2 A _ 0 } + \frac{ ( D \sin \theta + E \cos \theta ) \sin \theta }{ 2 B _ 0 } = \frac{ 2 B D + C E }{ 4 A B - C ^ 2 }
\]
\[\delta _ y = \frac{ ( D \cos \theta - E \sin \theta ) \sin \theta }{ - 2 A _ 0 } + \frac{ ( D \sin \theta + E \cos \theta ) \sin \theta }{ 2 B _ 0 } = \frac{ 2 B E + C D }{ 4 A B - C ^ 2 }
\]
\[F _ 0 = F - A _ 0 ( \delta _ x \cos \theta - \delta _ y \sin \theta ) ^ 2 - B _ 0 ( \delta _ x \sin \theta + \delta _ y \cos \theta ) ^ 2
\]
\[= F - \frac{ 1 }{ 2 } \left [ ( A + B ) ( \delta _ x ^ 2 + \delta _ y ^ 2 ) + \sqrt{ ( B - A ) ^ 2 + C ^ 2 } 4 \delta _ x \delta _ y \sin \theta \cos \theta \right ]
\]
\[= F - \frac{ ( A + B ) [ ( 2 B D + C E ) ^ 2 + ( 2 B E + C D ) ^ 2 ] + 4 C ( 2 B D + C E )( 2 B E + C D ) }{ 2 ( 4 A B - C ^ 2 ) ^ 2 }
\]
而今便可谓是大功告成
为了检验公式的正确性,带入一个斜椭圆的方程
\[\frac{ x ^ 2 }{ A _ x ^ 2 } + \frac{ y ^ 2 }{ A _ y ^ 2 } - 2 \frac{ x y }{ A _ x A _ y } \cos \phi = \sin ^ 2 \phi
\]
有
\[A = \frac{ 1 }{ A _ x ^ 2 } , B = \frac{ 1 }{ A _ y ^ 2 } , C = \frac{ 2 \cos \phi }{ A _ x A _ y } , D = 0 , E = 0 , F = - \sin ^ 2 \phi
\]
带入得
\[A _ 0 = \frac{ 1 }{ 2 } \left [ \left ( \frac{ 1 }{ A _ x ^ 2 } + \frac{ 1 }{ A _ y ^ 2 } \right ) - \sqrt{ \left ( \frac{ 1 }{ A _ y ^ 2 } - \frac{ 1 }{ A _ x ^ 2 } \right ) ^ 2 + \frac{ 4 \cos ^ 2 \phi }{ A _ x ^ 2 A _ y ^ 2 } } \mspace{ 2mu } \right ]
\]
\[B _ 0 = \frac{ 1 }{ 2 } \left [ \left ( \frac{ 1 }{ A _ x ^ 2 } + \frac{ 1 }{ A _ y ^ 2 } \right ) + \sqrt{ \left ( \frac{ 1 }{ A _ y ^ 2 } - \frac{ 1 }{ A _ x ^ 2 } \right ) ^ 2 + \frac{ 4 \cos ^ 2 \phi }{ A _ x ^ 2 A _ y ^ 2 } } \mspace{ 2mu }\right ]
\]
\[F _ 0 = - \sin ^ 2 \phi
\]
将 $ A _ 0 x ^ 2 + B _ 0 y ^ 2 + F _ 0 = 0$化成一个我们更熟悉的形式
\[\frac{ 1 }{ 2 \sin ^ 2 \phi } \left [ \left ( \frac{ 1 }{ A _ x ^ 2 } + \frac{ 1 }{ A _ y ^ 2 } \right ) - \sqrt{ \left ( \frac{ 1 }{ A _ y ^ 2 } - \frac{ 1 }{ A _ x ^ 2 } \right ) ^ 2 + \frac{ 4 \cos ^ 2 \phi }{ A _ x ^ 2 A _ y ^ 2 } } \mspace{ 2mu } \right ] x ^ 2 + \frac{ 1 }{ 2 \sin ^ 2 \phi } \left [ \left ( \frac{ 1 }{ A _ x ^ 2 } + \frac{ 1 }{ A _ y ^ 2 } \right ) + \sqrt{ \left ( \frac{ 1 }{ A _ y ^ 2 } - \frac{ 1 }{ A _ x ^ 2 } \right ) ^ 2 + \frac{ 4 \cos ^ 2 \phi }{ A _ x ^ 2 A _ y ^ 2 } } \mspace{ 2mu } \right ] y ^ 2 = 1
\]
首先这的确是个椭圆此乃一胜,再然后又另一个角度去求原椭圆的极值
\[G = x ^ 2 + y ^ 2 + \lambda \left ( \frac{ x ^ 2 }{ A _ x ^ 2 } + \frac{ y ^ 2 }{ A _ y ^ 2 } - 2 \frac{ x y }{ A _ x A _ y } \cos \phi - \sin ^ 2 \phi \right )
\]
\[\left \{ \begin{array}{rl} \dfrac{ \partial G }{ \partial x } & = 2 x + \lambda \left ( \frac{ 2 x }{ A _ x ^ 2 } - \frac{ 2 y }{ A _ x A _ y } \cos \phi \right ) = 0 \\ \dfrac{ \partial G }{ \partial y } & = 2 y + \lambda \left ( \frac{ 2 y }{ A _ y ^ 2 } -\frac{ 2 x }{ A _ x A _ y } \cos \phi \right ) = 0 \\ \dfrac{ \partial G }{ \partial \lambda } & = \frac{ x ^ 2 }{ A _ x ^ 2 } + \frac{ y ^ 2 }{ A _ y ^ 2 } - 2 \frac{ x y }{ A _ x A _ y } \cos \phi - \sin ^ 2 \phi = 0 \end{array} \right.
\]
解得
\[\Longrightarrow \left\{\begin{array}{rcl} \lambda & = & \frac{ - ( A _ x ^ 2 + A _ y ^ 2 ) \pm \sqrt{ ( A _ x ^ 2 + A _ y ^ 2 ) ^ 2 - 4 A _ x ^ 2 A _ y ^ 2 \sin ^ 2 \phi } }{ 2 \sin ^ 2 \phi } \\ x & = & \frac{ \sin \phi }{ \sqrt{ \frac{ 1 }{ A _ x ^ 2 } + \frac{ k ^ 2 }{ A _ y ^ 2 } - \frac{ 2 k \cos \phi }{ A _ x A _ y } } } \\ y & = & \frac{ k \sin \phi }{ \sqrt{ \frac{ 1 }{ A _ x ^ 2 } + \frac{ k ^ 2 }{ A _ y ^ 2 } - \frac{ 2 k \cos \phi }{ A _ x A _ y } } } \end{array} \right.
\]
其中
\[k = \sqrt{ \frac{ \frac{ \lambda }{ A _ y ^ 2 } + 1 }{ \frac{ \lambda }{ A _ x ^ 2 } + 1 } }
\]
来看看解得的长短轴自洽不自洽
引入$ \gamma = \frac{ A _ y }{ A _ x} $,有
\[k = \sqrt{ \frac{ - ( \gamma ^ { - 2 } + 1 ) \pm \sqrt{ ( \gamma ^ { - 2 } + 1 ) ^ 2 - 4 \gamma ^ { - 2 } \sin ^ 2\phi }+ 2 \sin ^ 2 \phi }{ - ( \gamma ^ 2 + 1 ) \pm \sqrt{ ( \gamma ^ 2 + 1 ) ^ 2 - 4 \gamma ^ 2 \sin ^ 2 \phi } + 2 \sin ^ 2 \phi } }
\]
\[= \frac{ 1 }{ \gamma } \sqrt{ \frac{ - ( \gamma ^ 2 + 1 ) \pm \sqrt{ ( \gamma ^ 2 + 1 ) ^ 2 - 4 \gamma ^ 2 \sin ^ 2 \phi } + 2 \gamma ^ 2 \sin ^ 2 \phi }{ - ( \gamma ^ 2 + 1 ) \pm \sqrt{ ( \gamma ^ 2 + 1 ) ^ 2 - 4 \gamma ^ 2 \sin ^ 2 \phi } + 2 \sin ^ 2 \phi } } = \frac{ \xi }{ \gamma }
\]
\[x = \frac{ A _ x \sin \phi }{ \sqrt{ 1 + \frac{ \xi ^ 2 }{ \gamma ^ 4 } - \frac{ 2 \xi \cos \phi }{ \gamma ^ 2 } } }
\]
\[y = \frac{ \xi }{ \gamma } \cdot \frac{ A _ x \sin \phi }{ \sqrt{ 1 + \frac{ \xi ^ 2 }{ \gamma ^ 4 } - \frac{ 2 \xi \cos \phi }{ \gamma ^ 2 } } }
\]
\[r ^ 2 = x ^ 2 + y ^ 2 = \frac{ A _ x ^ 2 \sin ^ 2 \phi }{ 1 + \frac{ \xi ^ 2 }{ \gamma ^ 4 } - \frac{ 2 \xi \cos \phi }{ \gamma ^ 2 } } \cdot \left ( 1 +\frac{ \xi ^ 2 }{ \gamma ^ 2 } \right )
\]
不难发现两解分别对应 $ A _ 0 、B _ 0 $
故而该公式的正确性得证。
这不比什么齐次化好用多了

浙公网安备 33010602011771号