easydessinfr | Accueil Télécharger easydessinfr.py |
|
@version: 1.0(2014-11-29) F. Laroche, http://pythonpourenfants.free.fr |
Modules nécessaires | ||||||
|
Fonctions principales | ||||||||||||||||||||||||||||||||
convdegrad (= math.pi/180) #conversion
des degrés en radian pour utiliser les fonctions sin et cos Liste de couleurs de base : colors=['white','black','grey','blue','cyan','green','yellow','red','pink' Dictionnaire de concordance entre noms de couleurs : Nb_couleursfr =len(couleursfr)
Traduction des couleurs de base : dans
les fonctions du module on donnera les couleurs en anglais, en français
ou sous la forme #rrggbb.
Convertit un triplet d'octets r, g, b en valeur hexadécimale (ex : #A1259F).
Dessine un canevas dans lequel on peut
dessiner.
Dessine un rectangle entre les points (x0,y0) et (x1, y1); il faut donner un nom !
Renvoie les coordonnées du centre d'un rectangle défini par deux sommets opposés.
Dessine une grille de
ncolonnes sur nlignes ;
Dessine un arc de cercle d'angle angle
(en degrés) démarrant à debutangle
(mesuré par rapport à un rayon horizonrtal)
Dessine un cercle de centre (x_C,
y_C) et de rayon rayon.
Dessine un segment entre les points (x0, y0) et (x1, y1) ; il faut donner un nom !
Dessine un texte centré au point (x0, y0) ; il faut donner un nom !
Charge l'image nomimage et la place centrée au point (x0, y0) ; il faut donner un nom à l'objet !
Dessine une étoile au centre xC,
yC, dans un cercle de rayon rayon
;
Retourne les coordonnées d'un
point M sur une droite passant par deux points A et B. t est un
nombre décimal.
Retourne les coordonnées d'un
point sur un ovale délimité par deux points A
et B.
Retourne les coordonnées d'un
point M', image d'un point M de coordonnées (xM,
yM)
Même chose que pour la rotation mais sur un ovale.
Retourne 5 nombres décimaux :
u, v, a, b, c qui sont nécessaires à l'obtention des
coordonnées
Retourne les coordonnées d'un
point M se déplaçant sur une parabole ABC en suivant
les valeurs de t entre 0 et 1 :
Retourne les coordonnées d'un
point sur une parabole commnçant en A, de sommet B et finissant
en C (on a juste besoin de l'abscisse de C).
Calcul de la distance entre les deux listes A=[a,b] et B=[c,d].
Renvoie la deuxième coordonnée d'un vecteur (a,b) ou (b,a) dont on connait la longueur.
Renvoie le signe de a (+1 ou -1).
Renvoie +1 ou -1 aléatoirement.
|
INFORMATION de LICENSE Easydessinfr version 1.0
Copyright (c) 2014, Frédéric Laroche. Tous droits réservés.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
ABOUT THE EASYGUI LICENSE
This license is what is generally known as the "modified BSD license",
aka "revised BSD", "new BSD", "3-clause BSD".
See http://www.opensource.org/licenses/bsd-license.php
This license is GPL-compatible.
See http://en.wikipedia.org/wiki/License_compatibility
See http://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses
The BSD License is less restrictive than GPL.
It allows software released under the license to be incorporated into proprietary products.
Works based on the software may be released under a proprietary license or as closed source software.
http://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_.28.22New_BSD_License.22.29