filmov
tv
Numerical Methods in Python Series - Lagrange Interpolation

Показать описание
Numerical Methods in Python Series - Lagrange Interpolation
this tutorial will show you how to implement Lagrange Interpolation case in Python along with the visualization.
In the mathematical field of numerical analysis, interpolation is a type of estimation, a method of constructing new data points within the range of a discrete set of known data points. - Wikipedia
The Lagrange interpolation formula is a way to find a polynomial which takes on certain values at arbitrary points.
steps:
1. open Google Colab
2. type in the code
line 1 - 6
we use PIL (Python Imaging Library) to draw the function
line 8
generating random numbers for n
line 9 - 10
creating list for x and y points
line 11 - 15
creating random x and y points and put it on the list
line 18 - 29
calculating Lagrange polynomial for each x
determine y and draw the pixels
line 32
initialize the radius
line 33 - 36
draw the function
you can try to put different data and see the result ;) in this code the result is different for each run because we randomize n, x, and y :)
References:
thanks for watching, don’t forget to subscribe, activate the notification bell, like this video and also share it to support this channel to be able to continuously creates useful tutorials :)
leave us some comments if there is any questions and let us know what you think :)
Intro and Outro created by ProCodeCG Kids: Islamey Fawwaz Alfattan
this tutorial will show you how to implement Lagrange Interpolation case in Python along with the visualization.
In the mathematical field of numerical analysis, interpolation is a type of estimation, a method of constructing new data points within the range of a discrete set of known data points. - Wikipedia
The Lagrange interpolation formula is a way to find a polynomial which takes on certain values at arbitrary points.
steps:
1. open Google Colab
2. type in the code
line 1 - 6
we use PIL (Python Imaging Library) to draw the function
line 8
generating random numbers for n
line 9 - 10
creating list for x and y points
line 11 - 15
creating random x and y points and put it on the list
line 18 - 29
calculating Lagrange polynomial for each x
determine y and draw the pixels
line 32
initialize the radius
line 33 - 36
draw the function
you can try to put different data and see the result ;) in this code the result is different for each run because we randomize n, x, and y :)
References:
thanks for watching, don’t forget to subscribe, activate the notification bell, like this video and also share it to support this channel to be able to continuously creates useful tutorials :)
leave us some comments if there is any questions and let us know what you think :)
Intro and Outro created by ProCodeCG Kids: Islamey Fawwaz Alfattan