An example with 3x3 matrix

main
Micke Nordin 2 years ago
parent 8e5bc40d6d
commit c558dacb46
Signed by: micke
GPG Key ID: 014B273D614BE877

@ -3,17 +3,25 @@
#include "../vectors/vector.hpp"
int main() {
vector v = vector(2);
v[0] = cnumber(1, 0);
v[1] = cnumber(0, 1);
vector a = vector(3);
a[0] = cnumber(1, 0);
a[1] = cnumber(0, 0);
a[2] = cnumber(0, 0);
vector w = vector(2);
w[0] = cnumber(1, 0);
w[1] = cnumber(0, -1);
vector b = vector(3);
b[0] = cnumber(0, 0);
b[1] = cnumber(1, 0);
b[2] = cnumber(0, 0);
matrix m = matrix(2, 2);
m[0] = v;
m[1] = w;
vector c = vector(3);
c[0] = cnumber(0, 0);
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;
return 0;

BIN
test

Binary file not shown.
Loading…
Cancel
Save