diff --git a/Cargo.toml b/Cargo.toml index 59c4482..2d49de5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "euclid" -version = "0.1.6" +version = "0.2.0" authors = ["The Servo Project Developers"] description = "Geometry primitives" documentation = "http://doc.servo.org/euclid/" diff --git a/src/matrix.rs b/src/matrix.rs index 6db2361..ebef7d7 100644 --- a/src/matrix.rs +++ b/src/matrix.rs @@ -303,8 +303,10 @@ impl Matrix4 { ) } - /// Create a 2d skew matrix - pub fn create_skew(sx: f32, sy: f32) -> Matrix4 { + /// Create a 2d skew matrix. + /// https://drafts.csswg.org/css-transforms/#funcdef-skew + pub fn create_skew(alpha: f32, beta: f32) -> Matrix4 { + let (sx, sy) = (beta.tan(), alpha.tan()); Matrix4::new(1.0, sx, 0.0, 0.0, sy, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0,