This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from shapely.geometry import Polygon, LineString | |
from shapely.ops import unary_union, polygonize | |
# I found it very challenging to find code online that properly finds the positive area between two curves. | |
# Here is an example that works: we want the area between a sin function and y = 0, which for one full period of a sin function is 4. | |
# This script calculates this area to be 3.994... close enough! |