bonjour je ne sais pas vraiment comment faire sur algobox si quelqu un peut m aider très vite svp c est pour demain merci
énoncé:
ecrire.un algorithme qui demande les coordonnée de deux.point distinct puis qui determine (si ellr.existe) la fonction affine dont la.courbe representative.passe par les.deux points choisis
et bien c est vraiment écrit comme sa
ecrire un algorithme qui demande les coordonnées de deux points distinct puis qui determine (si elle existe) la fonction affine dont la courbe representative.passe par les.deux points choisis
rappel de cours:
A (xA,yA) B(xB;yB)
y=mx+p
m= (yB-yA)/(xB-xA)
si xB-xA=0 , alors (yB-yA)/(xB-xA)= impossible
A toi
ce n'est pas encore l'algorithme bien sûr
Bonsoir.
Non testé :
VARIABLES
// point A
xA EST_DU_TYPE NOMBRE
yA EST_DU_TYPE NOMBRE
// point B
xB EST_DU_TYPE NOMBRE
yB EST_DU_TYPE NOMBRE
// a = (yA - yB) / (xA - xB)
a EST_DU_TYPE NOMBRE
// b = (xA.yB - xB.yA) / (xA - xB)
b EST_DU_TYPE NOMBRE
// y = ax + b
DEBUT_ALGORITHME
LIRE xA
LIRE yA
LIRE xB
LIRE yB
// droite verticale ?
SI xB != xA ALORS
DEBUT_SI
// non
a PREND_LA_VALEUR (yA - yB) / (xA - xB)
b PREND_LA_VALEUR (xA*yB - xB*yA) / (xA - xB)
AFFICHER "a = "
AFFICHER a
AFFICHER "b = "
AFFICHER b
FIN_SI
SINON
// oui
DEBUT_SINON
AFFICHER "droite x = "
AFFICHER xA
FIN_SINON
FIN_ALGORITHME
Vous devez être membre accéder à ce service...
Pas encore inscrit ?
1 compte par personne, multi-compte interdit !
Ou identifiez-vous :