java – implementation of a b-spline curve n points

hi i’m trying to implement the n points spline curve, but it seems like it requires some calculus knowledge.
Unfortunately I did not follow the calculation of high school.

I would like a function that takes a list of points x and y
and generate an interpolation like the following image.

enter image description here
I don’t know if it’s b-spline or bezier. I think it is the first.

I know java and python to draw points, but any language that is easy to understand.
I don’t want to use third party libraries or functions

Example pseudocode:
float () () inter_points () (2)
float () spline (float () x, float y ()) {
// algorithm here
return inter_points;

draw_ellipse (points () (0), points (1), 2,2)