resqpy.olio.vector_utilities.vertical_intercept

resqpy.olio.vector_utilities.vertical_intercept(x: float, x_values: ndarray, y_values: ndarray) Optional[float][source]

Finds the y value of a straight line between two points at a given x.

If the x value given is not within the x values of the points, returns None.

Parameters:
  • x (float) – x value at which to determine the y value.

  • x_values (np.ndarray) – the x coordinates of point 1 and point 2.

  • y_values (np.ndarray) – the y coordinates of point 1 and point 2.

Returns:

y (Optional[float])

y value of the straight line between point 1 and point 2,

evaluated at x. If x is outside the x_values range, y is None.