Fof is a MacOS application that captures the drawn X and Y points from a line and creates a rough approximation of the underlying function by generating arrays of the drawn co-ordinates and allows you to create interpolations in generated Java, JavaScript, Scala, and Python code.
Along with generating code you can also export a PNG of the graph.