likishi 2015-08-02 15:25 采纳率: 100%
浏览 1851
已采纳

关于CSS3 transform:matrix()牛角尖?

transform:scale(sx,sy) >>> transform:matrix(sx,0,0,sy,0,0)

transform:translate(tx,ty) >>> transform:matrix(1,0,0,1,tx,ty)

transform:skew(θx,θy) >>> transform:matrix(1,tan(θy),tan(θx),1,0,0)

transform:rotate(θ) >>> transform:matrix(cosθ,sinθ,-sinθ,cosθ,0,0)

既然transform都可以使用matrix(a,b,c,d,e,f)运算
而运算后:
x’=ax+cy+e
y’=bx+dy+f

那么:
translate:
x'= x+tx, x' 表示新坐标,
y'= y+ty, y' 表示新坐标.
scale:
x' = x*sx, x' 表示新宽度,
y' = y*sy, y' 表示新高度.

可是:
rotate:
x’ = x*cosθ-y*sinθ+0 = x*cosθ-y*sinθ
y’ = x*sinθ+y*cosθ+0 = x*sinθ+y*cosθ
这里的 x' 和 y' 值表示什么?
skew:
x’ = x+y*tan(θx)+0 = x+y*tan(θx)
y’ = x*tan(θy)+y+0 = x*tan(θy)+y
这里的 x' 和 y' 值表示什么?

  • 写回答

2条回答 默认 最新

  • likishi 2015-08-09 09:04
    关注

    牛角尖中钻出来了呵呵

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?