<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def locate_point(nodes, x_val, y_val):
 r"""Find the parameter corresponding to a point on a curve. .. note:: This assumes that the curve :math:`B(s, t)` defined by ``nodes`` lives in :math:`\mathbf{R}^2`. Args: nodes (numpy.ndarray):
 The nodes defining a B |eacute| zier curve. x_val (float):
 The :math:`x`-coordinate of the point. y_val (float):
 The :math:`y`-coordinate of the point. Returns: Optional[float]: The parameter on the curve (if it exists). """

    # First, reduce to the true degree of x(s) and y(s).
    zero1 = _curve_helpers.full_reduce(nodes[[0], :]) - x_val
    zero2 = _curve_helpers.full_reduce(nodes[[1], :]) - y_val
    # Make sure we have the lowest degree in front, to make the polynomial
    # solve have the fewest number of roots.
    if zero1.shape[1] > zero2.shape[1]:
        zero1, zero2 = zero2, zero1
    # If the "smallest" is a constant, we can't find any roots from it.
    if zero1.shape[1] == 1:
        # NOTE: We assume that callers won't pass ``nodes`` that are
        #       degree 0, so if ``zero1`` is a constant, ``zero2`` won't be.
        zero1, zero2 = zero2, zero1
    power_basis1 = poly_to_power_basis(zero1[0, :])
    all_roots = roots_in_unit_interval(power_basis1)
    if all_roots.size == 0:
        return None

    # NOTE: We normalize ``power_basis2`` because we want to check for
    #       "zero" values, i.e. f2(s) == 0.
    power_basis2 = normalize_polynomial(poly_to_power_basis(zero2[0, :]))
    near_zero = np.abs(polynomial.polyval(all_roots, power_basis2))
    index = np.argmin(near_zero)
    if near_zero[index] < _ZERO_THRESHOLD:
        return all_roots[index]

    return None