bezierkromme.py

Created by numworks-nl

Created on November 22, 2022

419 Bytes


from matplotlib.pyplot import *
import math

PN = 10
T0 = 0
T1 = 1
Ax = 0
Ay = 4
Bx = 2
By = 2
t = [i/(PN-1) for i in range(PN)]
CRange = 10

for i in range(CRange):
    Cx = 3 - 5*i/CRange
    Cy = 0
    x = [(1-ti)**2*Ax + ti**2*Bx + 2*ti*(1-ti)*Cx for ti in t]
    y = [(1-ti)**2*Ay + ti**2*By + 2*ti*(1-ti)*Cy
         for ti in t]
    plot(x,y,[255*i/CRange, 0, 255*(1-i/CRange)])
grid()
show()

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.