- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
#include<stdio.h>
#include<conio.h>
#include<math.h>
#define eps 0.001
float Phi1 (float x_pred[1])
{
return asin(1.2 + x_pred[1]) - 1;
}
float Phi2 (float x_pred[0])
{
return acos(2 - 2*x_pred[0]);
}
int main ()
{
float x_pred[1],x[1];
float norma;
x_pred[0] = 0.4;
x_pred[1] = -0.3;
do
{
x[0] = Phi1(x_pred[1]);
x[1] = Phi2(x_pred[0]);
printf("%6.2f",x[0]);
printf(" %6.2f\n",x[1]);
norma = (fabs(x[0] - x_pred[0])) > fabs((x[1] - x_pred[1])) ? fabs(x[0] - x_pred[0]) : fabs(x[1] - x_pred[0]);
if (norma >= eps) break;
else
{
x_pred[0] = x[0];
x_pred[1] = x[1];
}
}
while (1);
getch();
return 0;
}