Write a polynomial equation given the x and y coordinates of the points in the graph

51 Views Asked by At

I'm trying to write a program that would generate a polynomial equation (degree 6) of a graph given the x and y coordinates of the points present in the graph. Somehow similar to how excel can provide a user with a specific trendline in their graphs. Unfortunately, I couldn't find the solution I was looking for while browsing the internet, nor have I retained information regarding this (if this specific question was ever raised in high school).

I was hoping someone could teach me how to manually do it so that I could translate it into code. Or if you have any link that could help me I would gladly check them out.

Thank you for your time!