An example with 3x3 matrix
This commit is contained in:
parent
8e5bc40d6d
commit
c558dacb46
2 changed files with 17 additions and 9 deletions
26
matrix.cpp
26
matrix.cpp
|
@ -3,17 +3,25 @@
|
||||||
#include "../vectors/vector.hpp"
|
#include "../vectors/vector.hpp"
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
vector v = vector(2);
|
vector a = vector(3);
|
||||||
v[0] = cnumber(1, 0);
|
a[0] = cnumber(1, 0);
|
||||||
v[1] = cnumber(0, 1);
|
a[1] = cnumber(0, 0);
|
||||||
|
a[2] = cnumber(0, 0);
|
||||||
|
|
||||||
vector w = vector(2);
|
vector b = vector(3);
|
||||||
w[0] = cnumber(1, 0);
|
b[0] = cnumber(0, 0);
|
||||||
w[1] = cnumber(0, -1);
|
b[1] = cnumber(1, 0);
|
||||||
|
b[2] = cnumber(0, 0);
|
||||||
|
|
||||||
matrix m = matrix(2, 2);
|
vector c = vector(3);
|
||||||
m[0] = v;
|
c[0] = cnumber(0, 0);
|
||||||
m[1] = w;
|
c[1] = cnumber(0, 0);
|
||||||
|
c[2] = cnumber(0, -1);
|
||||||
|
|
||||||
|
matrix m = matrix(3, 3);
|
||||||
|
m[0] = a;
|
||||||
|
m[1] = b;
|
||||||
|
m[2] = c;
|
||||||
|
|
||||||
cout << m << endl;
|
cout << m << endl;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
BIN
test
Executable file
BIN
test
Executable file
Binary file not shown.
Loading…
Add table
Reference in a new issue