class AxeQuat{ float rapport,rap; Vecteur axe; int pas; float zangle,yangle,angle;// les angles d'Euler du vecteur axe public AxeQuat(){ this.rapport=2.0f; this.pas=50; this.rap=pow(rapport,1.0f/pas); this.angle=5*PI/3; this.axe=new Vecteur(1,0,0); //this.axeU=new Vecteur(1,0,0); } public void dessiner(Vecteur b){ line(0 ,0 ,0 ,b.x ,b.y ,b.z); axe=b.normerCopie(1.0f); zangle=atan2(axe.y,axe.x); yangle=-atan2(axe.z,sqrt(sq(axe.x)+sq(axe.y))); stroke(255); line(0,0,0,vectImpact.x,vectImpact.y,vectImpact.z); pushMatrix();//dessin du cylindre blanc rotateZ(zangle); rotateY(yangle); fill(255); noStroke(); beginShape(QUADS); for(int i=0;i<=12;i++){ float a1=PI/6*i,a2=PI/6*(i+1); float lim=vectImpact.length(); vertex(-500,4*cos(a1),4*sin(a1)); vertex(-500,4*cos(a2),4*sin(a2)); vertex(lim,4*cos(a2),4*sin(a2)); vertex(lim,4*cos(a1),4*sin(a1)); } endShape(); popMatrix(); pushMatrix();//placer l'image de la photo rotate(angle,axe.x,axe.y,axe.z); scale(rapport); image(brazil,50,50,200,200); popMatrix(); texte="étape 0 : l'image de la photo bleu par la similitude d'axe blanc d'angle "+angle+" et de rapport "+rapport; if(etape==1){ texte="étape 1 : les arcs des chemins reliant les pixels de la photo bleue à ceux de sa transformée"; afficherArcs(angle); float angleO=-angle/abs(angle)*2*PI+angle; afficherArcs(angleO); } if(etape==2){ Quat qu=new Quat( quatsystem.axe, quatsystem.angle, quatsystem.rapport); texte="étape 2 : les arcs du quaternion q ="+qu.w+" + "+qu.x+"*i + "+qu.y+"*j + "+qu.z+"*k"; afficherArcs(angle); } if(etape==3){ float angleO=-angle/abs(angle)*2*PI+angle; Quat qu=new Quat(axe,angleO,rapport); texte="étape 3 : les arcs du quaternion p ="+qu.w+" + "+qu.x+"*i + "+qu.y+"*j + "+qu.z+"*k"; afficherArcs(angleO); } } void afficherArcs(float angl){ pushMatrix();//dessin des arcs for(int i=0;i