| 1 | # -*- coding: utf-8 -*- |
| 2 | |
| 3 | from tools.testlib import rand |
| 4 | #from wxgeometrie.geolib import (Point, Segment, Droite, Cercle, Vecteur, Variable, Polygone, |
| 5 | # Vecteur_libre, Droite_equation, Cercle_equation, Angle, Mediatrice, |
| 6 | # Arc_cercle, Demidroite, Milieu, Carre, Rectangle, Barycentre, |
| 7 | # Reflexion, Homothetie, Rotation, Translation, Representant, |
| 8 | # Triangle, Feuille, Fonction, Parallelogramme, contexte, Texte, |
| 9 | # RIEN, TEXTE, FORMULE, NOM) |
| 10 | |
| 11 | from wxgeometrie.geolib import Point, Vecteur_libre, Droite_equation, Cercle_equation |
| 12 | |
| 13 | def rand_pt(): |
| 14 | return Point(rand(), rand()) |
| 15 | |
| 16 | def rand_vec(): |
| 17 | return Vecteur_libre(rand(), rand()) |
| 18 | |
| 19 | def rand_dte(): |
| 20 | return Droite_equation(rand(), rand(), rand()) |
| 21 | |
| 22 | def rand_cercle(): |
| 23 | a = rand() |
| 24 | b = rand() |
| 25 | c = (a**2+b**2-abs(rand()))/4 |
| 26 | return Cercle_equation(a, b, c) |