import pyxel import numpy as np SEGMENTS = 1000 pyxel.init(400, 400) pyxel.colors[0] = 0xcecece pyxel.colors[1] = 0x370028 pyxel.cls(0) def bezier1_point(vec_ctrls, t): p = (1-t) * vec_ctrls[0] + t * vec_ctrls[1] return p def trace(pt_ctrls): vec_ctrls = np.array(pt_ctrls) for i in range(SEGMENTS+1): t = i/SEGMENTS p = bezier1_point(vec_ctrls, t) pyxel.circ(*p, 1, 1) points_du_controle = [ [350, 50], [50, 350] ] trace(points_du_controle) pyxel.show()