Using bisection method inside the python component to find the closest point on an arc to a point

Dear all,

I am trying to simulate the bisection method* to find the closest point on a reparametrized arc to a given point. I studied the mathematical concept, yet I am not able to define the required function to calculate the derivative. Especially since it should calculate the derivative according to a point on the arc. Could you guide me or give me any resources that would help me do so?


*Bisection method - Wikipedia
*Bisection Method: Algorithm - YouTube