def rotate(curve, degs, origin=None):
def transform(z):<EOL><INDENT>return exp(<NUM_LIT>*radians(degs))*(z - origin) + origin<EOL><DEDENT>if origin is None:<EOL><INDENT>if isinstance(curve, Arc):<EOL><INDENT>origin = curve.center<EOL><DEDENT>else:<EOL><INDENT>origin = curve.point(<NUM_LIT:0.5>)<EOL><DEDENT><DEDENT>if isinstance(curve, Path):<EOL><INDENT>return Path(*[rotate(seg, degs, origin=origin) for seg in curve])<EOL><DEDENT>elif is_bezier_segment(curve):<EOL><INDENT>return bpoints2bezier([transform(bpt) for bpt in curve.bpoints()])<EOL><DEDENT>elif isinstance(curve, Arc):<EOL><INDENT>new_start = transform(curve.start)<EOL>new_end = transform(curve.end)<EOL>new_rotation = curve.rotation + degs<EOL>return Arc(new_start, radius=curve.radius, rotation=new_rotation,<EOL>large_arc=curve.large_arc, sweep=curve.sweep, end=new_end)<EOL><DEDENT>else:<EOL><INDENT>raise TypeError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>
Returns curve rotated by `degs` degrees (CCW) around the point `origin`
    (a complex number).  By default origin is either `curve.point(0.5)`, or in
    the case that curve is an Arc object, `origin` defaults to `curve.center`.