First commit
This commit is contained in:
29
IUT/Info1/TD/Exercices/2.10_interpolation/2.10.md
Normal file
29
IUT/Info1/TD/Exercices/2.10_interpolation/2.10.md
Normal file
@@ -0,0 +1,29 @@
|
||||
Interpolation: une fonction (yb: un réel, ya: un réel, alpha: un réel) -> un réel
|
||||
CalculAlpha: une fonction (xa: un réel, xb: un réel, xc: un réel) -> un réel
|
||||
|
||||
Interpolation (yb: un réel, ya: un réel, alpha: un réel) -> un réel
|
||||
Lexique: {Local à Interpolation}
|
||||
yc: un réel
|
||||
Algortihme: {Local à Interpolation}
|
||||
yc <- alpha * yb + (1 - alpha) * ya
|
||||
Retourner(yc)
|
||||
|
||||
CalculAlpha (xa: un réel, xb: un réel, xc: un réel) -> un réel
|
||||
Lexique : {Local à CalculAlpha}
|
||||
alpha: un réel
|
||||
Algorithme : {Local à CalculAlpha}
|
||||
alpha <- (xc - xa)/(xb - xa)
|
||||
Retourner(alpha)
|
||||
|
||||
Principal
|
||||
Lexique :
|
||||
xa, ya, xb, yb, xc, yc: 6 réels
|
||||
alpha: un réel
|
||||
Algorithme
|
||||
Ecrire("Saisir xa, ya, xb, yb, xc")
|
||||
Lire(xa, ya, xb, yb, xc)
|
||||
|
||||
alpha <- CalculAlpha(xa, xb, xc)
|
||||
yc <- Interpolation(yb, ya, alpha)
|
||||
|
||||
Ecrire("yc vaut ", yc)
|
||||
Reference in New Issue
Block a user