• Aucun résultat trouvé

Rantanplan et les trois Dalton !

N/A
N/A
Protected

Academic year: 2022

Partager "Rantanplan et les trois Dalton !"

Copied!
1
0
0

Texte intégral

(1)

BTSSIO:DOC 9

Une correction du TD 9

2017-2018

Rantanplan et les trois Dalton !

Une

orretion

import turtle as t from random import*

def triangle3freres():

t.setup(1000,900) t.penup()

t.goto(0,400) t.pendown()

t.write(" Joe",font=("Book Antigua",20)) t.goto(400,-200)

t.write("Jack",font=("Book Antigua",20)) t.goto(-400,-300)

t.write("William",font=("Book Antigua",20)) t.goto(0,400)

t.penup()

def DemiParcours(xd,yd,xa,ya,couleur):

t.goto(xd,yd) xm=(xa+xd)/2 ym=(ya+yd)/2 t.goto(xm,ym) t.pendown() t.dot(8,couleur) t.penup()

return [xm,ym]

def PositionRantanplan():

x=randint(-400,400) y=randint(-400,400) return [x,y]

def CarteTrousRantanplan(n):

t.speed(200) triangle3freres()

On peut également astreindre la fonction PositionRantanplan() à renvoyer une position de Rantanplan à l’intérieur du triangle formé par les trois Dalton. On a besoin dans ce cas de déterminer les équations des droites

« supportant » les côtés du triangle.

Moyennant l’utilisation de formules vues au lycée, on détermine les trois équations : y = 1

8 x−250 ; y = 7 4 x+400 et y = −

3

2 x + 400. D’où la fonction possible :

def PositionRantanplan():

L=[]

x=randint(-400,400) y=randint(-400,400)

while y<1/8*x-250 or y>7/4*x+400 or y>-3/2*x+400 : x=randint(-400,400)

y=randint(-400,400) L.extend([x,y])

return L

My Maths Space 1 sur 1

Références

Documents relatifs

Avec 13 jetons, voici le plus grand triangle équilatéral qu’elle peut réaliser : Combien de jetons va-t-elle utiliser pour réaliser le plus grand triangle équilatéral possible

Justifiez le fait que les trois entiers naturels x, y et z sont tous impairs ou que deux d’entre eux sont pairs.. Trois entiers naturels

[r]

Compléter ensuite le tableau suivant en regroupant les éléments d’une même famille en colonne, et en suivant l’ordre croissant de masse (on ne s’occupera pas pour

The geometry and electronic properties of the copper ligands a ff ect the electron density of the oxygen atoms of the heterodinuclear {Ni( μ -O) 2 } core and 3a/3b undergo

According to the general procedure, complex 5l was obtained as a deep-red solid (97 mg, 99%). This article is licensed under a Creative Commons Attribution-NonCommercial 3.0

On l’a d´ej `a fait pour les g´eom´etries `a courbure constante : pour la g´eom´etrie euclidienne, prendre un r´eseau de translations, et pour la g´eom´etrie sph´erique,

Namely, the carbon dioxide insertion process is significantly accelerated in the presence of a strongly electron donating ligand trans to the growing polymer chain, which is in