def area(self, chord_length=<NUM_LIT>):
def area_without_arcs(path):<EOL><INDENT>area_enclosed = <NUM_LIT:0><EOL>for seg in path:<EOL><INDENT>x = real(seg.poly())<EOL>dy = imag(seg.poly()).deriv()<EOL>integrand = x*dy<EOL>integral = integrand.integ()<EOL>area_enclosed += integral(<NUM_LIT:1>) - integral(<NUM_LIT:0>)<EOL><DEDENT>return area_enclosed<EOL><DEDENT>def seg2lines(seg):<EOL><INDENT>"""<STR_LIT>"""<EOL>num_lines = int(ceil(seg.length() / chord_length))<EOL>pts = [seg.point(t) for t in np.linspace(<NUM_LIT:0>, <NUM_LIT:1>, num_lines+<NUM_LIT:1>)]<EOL>return [Line(pts[i], pts[i+<NUM_LIT:1>]) for i in range(num_lines)]<EOL><DEDENT>assert self.isclosed()<EOL>bezier_path_approximation = []<EOL>for seg in self:<EOL><INDENT>if isinstance(seg, Arc):<EOL><INDENT>bezier_path_approximation += seg2lines(seg)<EOL><DEDENT>else:<EOL><INDENT>bezier_path_approximation.append(seg)<EOL><DEDENT><DEDENT>return area_without_arcs(Path(*bezier_path_approximation))<EOL>
Find area enclosed by path.

        Approximates any Arc segments in the Path with lines
        approximately `chord_length` long, and returns the area enclosed
        by the approximated Path.  Default chord length is 0.01.  If Arc
        segments are included in path, to ensure accurate results, make
        sure this `chord_length` is set to a reasonable value (e.g. by
        checking curvature).

        Notes
        -----
        * Negative area results from clockwise (as opposed to
        counter-clockwise) parameterization of the input Path.

        To Contributors
        ---------------
        This is one of many parts of `svgpathtools` that could be 
        improved by a noble soul implementing a piecewise-linear 
        approximation scheme for paths (one with controls to guarantee a
        desired accuracy).