物件的旋轉
Author: 藍邦偉  老師

旋轉

P(x,y)

P'(x',y')

點的旋轉

直線的旋轉

橢圓的旋轉

拋物線的旋轉

θ

將點P(x,y)以原點為中心旋轉θ得P'(x',y')

\left[\begin{array}{cc} x' \ y' \ \end{array}\right]=\left[\begin{array}{cc} cosθ &- sinθ \ sinθ & cosθ \ \end{array}\right]\left[\begin{array}{cc} x \ y \ \end{array}\right]

=\left[\begin{array}{cc} xcosθ-ysinθ \ xsinθ+ycosθ \ \end{array}\right]

將直線L:ax+by+c=0以原點為中心旋轉θ得L'

u = Vector((x(Corner[1.0]), 0.0), (x(Corner[3.0]), 0.0))
v = Vector((0.0, y(Corner[1.0])), (0.0, y(Corner[3.0])))
O = (0, 0)
θ = 0 rad (slider from 0 to 6.283185307179586, step 0.017453292519943295)
P = (3.18, 1.26)
w = Vector(O, P)
P' = Rotate(P, θ, O)
z = Vector(O, P')
a = false
b = 1 (slider from 0 to 1, step 1)
c = true
d = 1 (slider from 0 to 1, step 1)
e = false
f = 1 (slider from 0 to 1, step 1)
g = true
h = 1 (slider from 0 to 1, step 1)
α = Angle(P, O, P')