intersection

intersection(x, y1, y2, xlog=False)[source]

Find the (first) intersection point for two line segments.

Parameters
  • x (ndarray) – The x coordinates.

  • y1, y2 (ndarray) – The two lists of y coordinates.

  • xlog (bool, optional) – Whether to find the x coordinate intersection in logarithmic space.

Example

>>> import climopy as climo
... x = 10 + np.arange(4)
... y1 = np.array([4, 2, 0, -2])
... y2 = np.array([0, 1, 2, 3])
... climo.intersection(x, y1, y2)