# Importation des modules from random import random import matplotlib import matplotlib.pyplot as plt # Création d'une liste de points aléatoires dont les coordonnées # sont comprises entre (0,0) et (10,10) exclu def points_aleatoire(n) : l_abs, l_ord = [],[] for i in range(n): l_abs.append(10*random()) l_ord.append(10*random()) return l_abs,l_ord # Création de la liste des points image def image(x,y) : l = len(x) newx, newy = [],[] for i in range(l) : newx.append(3*x[i]+2*y[i]) newy.append(2*x[i]+3*y[i]) return newx,newy # Tracé des points x,y = points_aleatoire(10000) plt.scatter(x,y,marker='.') newx,newy = image(x,y) plt.scatter(newx,newy,marker='.') plt.show()