All pastes #457523 Raw Edit

laloutre

public c v1 · immutable
#457523 ·published 2007-04-25 13:22 UTC
rendered paste body
//fonction de produit scalaire et angle entre deux vecteurs.****************        float angle_deux_vect(arete * a ,arete *b)        {            float scal , cosinusteta , teta;                        scal = ( a->vect.x * b->vect.x ) + ( a->vect.y *b->vect.y );            cosinusteta = scal / ( a->vect.norme * b->vect.norme );            teta = cos( cosinusteta )*180/pi;   //        printf("arete1.vect: %.1f %.1f arete2.vect: %.1f %.1f \n",a->vect.x,a->vect.y,b->vect.x,b->vect.y);    //       printf("scalaire a :%.1f costeta a: %.1f et angle a %.1f\n",scal,cosinusteta,teta);            return(teta);            }     //transformation d'une arete en vecteur***************************************     void transf_ar_vect(arete * arete1)     {                  arete1->vect.x = arete1->d.x - arete1->g.x;                  arete1->vect.y =  arete1->d.y - arete1->g.y ;                  arete1->vect.norme = sqrt(pow(arete1->vect.x,2)+pow(arete1->vect.y,2));                                                                               }