example_visuel.py

Created by archange

Created on October 12, 2024

832 Bytes

Here’s the example file to use on the Numworks, in coordination with the library Visuel.


  • The link to the library: Visuel
  • The link to the project: Github


from visuel import *

A,B,C,D,E = Point(20,20,'A'),Point(160,111,'B'),Point(20,202,'C'),Point(300,20,'D'),Point(300,202,'E')
F = milieu(D,E);F.round();F.name = 'F'
V,W,Y,X = Vector(A,B,name="V"),Vector(B,C,name="W"),Vector(F,D,name="Y"),Vector(F,E,name="X");U = V+W;U.name = "U"

def example():
  draw_points([A,B,C,D,E,F],"r",style=".")
  draw_rectangle(A,E)
  draw_croix(B,320)
  bezier_curve([A,B,C,E],"orange")
  bezier_curve([E,B,D,A],"orange")
  draw_circle(B,50,"r")
  fill_circle(B,10,"r")
  draw_droite(D,E,"cyan","d'");draw_droite(D,B,"cyan","d''");draw_droite(E,B,"cyan","d'''")
  draw_vector(A,V,"g");draw_vector(B,W,"g");draw_vector(A,U,"g")
  draw_arrows([(F,D)],"blue",fill=True);draw_arrows([(F,E)],"blue",fill=True)
  draw_polygone(6,50,B)
  fill_polygone(6,50,B,"yellow",alpha=0.5)

example()

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.