Skip to content

Commit

Permalink
Add skew x and y together
Browse files Browse the repository at this point in the history
  • Loading branch information
rsheeter committed Aug 2, 2021
1 parent a2117e1 commit 8518c64
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/picosvg/svg_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,18 @@ def rotate(self, a, cx=0.0, cy=0.0):
.translate(-cx, -cy)
)

# https://www.w3.org/TR/SVG11/coords.html#SkewXDefined
# Note that andl here is in radians
def skewx(self, a):
return self.matrix(1, 0, tan(a), 1, 0, 0)

# https://www.w3.org/TR/SVG11/coords.html#SkewYDefined
# Note that angle here is in radians
def skewy(self, a):
return self.matrix(1, tan(a), 0, 1, 0, 0)

# Note that angle here is in radians
def skew(self, xAngle, yAngle):
return self.matrix(1, tan(yAngle), tan(xAngle), 1, 0, 0)

def determinant(self) -> float:
return self.a * self.d - self.b * self.c

Expand Down

0 comments on commit 8518c64

Please sign in to comment.