matrix的應用

rotate: spa

matrix(cosθ,sinθ,-sinθ,cosθ,0,0)
x' = x*cosθ-y*sinθ+0 = x*cosθ-y*sinθ
y' = x*sinθ+y*cosθ+0 = x*sinθ+y*cosθ

skew: code

matrix(1,tan(θy),tan(θx),1,0,0)
x' = x+y*tan(θx)+0 = x+y*tan(θx) 
y' = x*tan(θy)+y+0 = x*tan(θy)+y

對稱blog

a = (1-k*k)/(k*k+1);
b = 2k/(k*k+1);
c = 2k/(k*k+1);
d = (k*k-1)/(k*k+1);
相關文章
相關標籤/搜索