Fonctions affines. Tableaux de signes . Inéquations produit et Inéquations quotient

Algorithme - Exercice 1

5 min
15
Question 1
Saisir xAx_{A} ; yAy_{A} ; xBx_{B} ; yBy_{B}
ayByAxBxAa\leftarrow \frac{y_{B} -y_{A} }{x_{B} -x_{A} }
byAm×xAb\leftarrow y_{A} -m\times x_{A}
Afficher aa , bb

Quel est le rôle de l’algorithme ci-dessus ?

Correction
  • L'instruction ayByAxBxAa\leftarrow \frac{y_{B} -y_{A} }{x_{B} -x_{A} } nous rappelle le calcul le coefficient directeur d'une droite.
  • L'instruction byAm×xAb\leftarrow y_{A} -m\times x_{A} permet de calculer l'ordonnée à l'origine.
  • Cette algorithme permet donc de calculer l'équation de la droite définie par les points A(xA;yA)A\left(x_{A};y_{A}\right) et B(xB;yB)B\left(x_{B};y_{B}\right)