Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const
- n = 2;
- eps = 1000;
- var
- col, row, i, j: integer;
- r,c,s, row_i, col_i: real;
- mas: array [0..n, 0..n] of real;
- begin
- mas[0, 0] := 0; mas[0, 1] := -1; mas[0, 2] := 1;
- mas[1, 0] := 4; mas[1, 1] := 2; mas[1, 2] := 0;
- mas[2, 0] := 3; mas[2, 1] := 4; mas[2, 2] := 0;
- for col := 0 to n do
- begin
- for row := col+1 to n do
- if mas[row, col] <> 0 then
- begin
- r := sqrt(mas[col, col]*mas[col, col] + mas[row, col]*mas[row, col]);
- c := mas[col, col] / r;
- s := -mas[row, col] / r;
- for i := 0 to n do
- begin
- col_i := mas[col, i] * c + mas[row, i] * (-s);
- row_i := mas[col, i] * s + mas[row, i] * c;
- mas[col, i] := col_i;
- mas[row, i] := row_i;
- end;
- end;
- end;
- writeln('R:');
- for i := 0 to n do
- begin
- for j := 0 to n do
- write(round(mas[i, j] * eps) / eps, Chr(9));
- writeln();
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement