Page 92 - Demo
P. 92

TI Python BootCamp ROBOTICS
A sin ride
from math import *
import ti_rover as rv
points=10
scale=2*pi/points
x=[i*scale for i in range(points+1)]
for i in x: ¨¨rv.to_xy(i,sin(i))
In een cirkel rijden from math import *
import ti_rover as rv
points = 6
scale = 2*pi/points
p=[i*scale for i in range(points+1)]
for t in parameter: ¨¨x=2*cos(t) ¨¨y=2*sin(t) ¨¨rv.to_xy(x,y)
Python TI-INNOVATORTM TECHNOLOGIE
  from turtle import * from math import *
rv=Turtle() rv.pencolor(255,0,0)
points=10 scale=2*pi/points
x=[i*scale for i in range(points+1)] for i in x:
¨¨rv.goto(20*i,20*sin(i))
from turtle import * from math import *
rv=Turtle() rv.pencolor(0,0,255)
points=10 scale=2*pi/points
p=[i*scale for i in range(points+1)] fortinp:
¨¨x=50*cos(t)
¨¨y=50*sin(t)
¨¨rv.goto(x,y)
 © 2020 T3 Nederland – T3 Vlaanderen
8 www.t3nederland.nl – www.t3vlaanderen.be






































































   90   91   92   93   94