Numerical Methods in Python Series - Lagrange Interpolation

Опубликовано: 27 Июнь 2021
на канале: ProCode CG
831
8

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


3. run the code and the graph will be saved in “Polynomial_Interpolation.png”, “PNG”)

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:
1. http://code.activestate.com/recipes/5...

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

visit our website: http://procodecg.com

and blog: https://procodecg.wordpress.com

and follow us on Instagram:   / procodecg  

Twitter:   / procodecg  

Facebook:   / procodecg  


На этой странице сайта вы можете посмотреть видео онлайн Numerical Methods in Python Series - Lagrange Interpolation длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь ProCode CG 27 Июнь 2021, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 831 раз и оно понравилось 8 зрителям. Приятного просмотра!