constante N : entier <- ... { Type agrege de stockage des informations } { relatives a une position en trois dimensions } structure position3D   x : reel <- 0.0   y : reel <- 0.0   z : reel <- 0.0 fin structure { Methode de calcul de la distance } { entre une positon3D et l'origine } reel fonction distanceOrigine(p) Données p : position3D Locales d : reel d = sqrt(p.x*p.x+p.y*p.y+p.z*p.z) retourner d fin fonction { Methode de recherche de l'indice de la valeur } { maximale d'un tableau de position3D restreint } { a ses n premieres valeurs } entier fonction indiceMaximum(n,t) Données n : entier t : Tableau [N] de position3D Locales max : reel iMax : entier i : entier d : reel max <- distanceOrigine(t[n]) iMax <- n pour i de n-1 à 0 pas -1 faire d <- distanceOrigine(t[i]) si d > max alors max <- d iMax <- i fsi fait retourner iMax fin fonction { Methode de tri par selection d'un tableau } { de position3D en fonction de la distance } { a l'origine } action triSelectionTableauPosition3D(t) Donnees / Resultat t : Tableau [N] de position3D Locales i : entier aux : position3D iMax : entier pour i de N-1 à 1 pas -1 faire iMax <- indiceMaximum(i,t) si iMax != i alors aux <- t[iMax] t[iMax] <- t[i] t[i] <- aux fsi fait fin action