9Fermer11
cidrolinLe 12/10/2009 à 20:53
Sasume (./5) :
./3 Sur TI, l’OS te fournit déjà plein d’opérations mathématiques (cf http://tigcc.ticalc.org/doc/timath.html ). Et ça doit être pareil avec PedroM.



MAis c'est looooooooong pour tracer un graphique.

un pauvre sinus prend 2 secondes.

Alors qu'avec une fonction de ce genre, c'est (quasi)-instantané.

 void i_sin(float w)
 {
 	ypix_tab[0] = sin(-2*w);

 	ypix_tab[1] = sin(-w);

 	const float p = 2.0 * cos(w);
 	
 	int i;
 	for (i=2; i<160; i++ )

 	{

 		ypix_tab[i] = p*ypix_tab[i-1] - ypix_tab[i-2];


 	}
 }


c'est un cas particulier, mais j'y travaille