[Coordinate transformation] Simple derivation of coordinate transformation of coordinate system--to be continued

As shown in the figure, assuming a known coordinate system ( X , Y ) (X,Y)(X,Y ) , the rotated coordinate system is( X ′ , Y ′ ) (X',Y')(X,Y ), the rotation angle isθ \thetaθ , assuming point p is at( X , Y ) (X,Y)(X,Y ) coordinate system is( x , y ) (x,y)(x,y ) , the coordinate system after rotation (ie( X ′ , Y ′ ) (X',Y')(X,Y )), the coordinates in( l , w ) (l,w)(l,w)

insert image description here

According to the geometric relationship in the figure, ( x , y ) (x,y) can be expressed(x,y )( l , w ) (l,w)(l,w ) Equation
x = l cos ⁡ θ − w sin ⁡ θ y = l sin ⁡ θ + w cos ⁡ θ x=l\cos\theta-w\sin\theta\\ y=l\sin\theta+ w\cos\thetax=lcosiwsiniy=lsini+wcosi

That is, the coordinate conversion formula is

[ xy ] = [ cos ⁡ θ , − sin ⁡ θ sin ⁡ θ , cos ⁡ θ ] [ lw ] \begin{bmatrix} x \\ y \end{bmatrix}=\begin{bmatrix} \cos\theta, \ -\sin\theta\\sin\theta,\\cos\theta\end{bmatrix}\begin{bmatrix}l\w\end{bmatrix}[xy]=[cosi , sinisini , cosi][lw]

Plus translation, as shown in the figure below, assuming ( X ′ , Y ′ ) (X',Y')(X,Y )OriginO ′ O'O( X , Y ) (X,Y)(X,Y ) The coordinates in the coordinate system are( x 0 , y 0 ) (x_0,y_0)(x0,y0) ,also consider
[ xy ] = [ cos ⁡ θ , − sin ⁡ θ sin ⁡ θ , cos ⁡ θ ] [ lw ] + [ x 0 y 0 ] \begin{bmatrix} x \\ y \end{ bmatrix} =\begin{bmatrix}\cos\theta,\-\sin\theta\\\sin\theta,\\cos\theta\end{bmatrix}\begin{bmatrix}l\w\end{bmatrix} +\begin{bmatrix}x_0\\y_0\end{bmatrix}[xy]=[cosi , sinisini , cosi][lw]+[x0y0]

insert image description here

[ cos ⁡ θ , − sin ⁡ θ sin ⁡ θ , cos ⁡ θ ] \begin{bmatrix} \cos\theta, \ -\sin\theta \\ \sin\theta, \ \cos\theta \end{bmatrix}[cosi , sinisini , cosi] is actually a rotation matrix.


Dividing line – to be continued


Guess you like

Origin blog.csdn.net/weixin_42301220/article/details/130877499