#include "../ltrans.h"
#include <math.h>
#include <stdio.h>
#include <assert.h>



main()
{
 C ltransform a(matrix22(.8, 1, -.21, .9), vector2(1, -3));

 C ltransform b = a*a;
 cout << "the square of\n" << a << "\n is\n" << b << "\n";
 C ltransform c = sqrt(b);
 cout << "Result of sqrt():\n" << c << "\n";
 assert(dist(c.Shift()-a.Shift()) < 1e-7);
 assert((c.Warp()-a.Warp()).norm() < 1e-7);

 C ltransform c2 = c*c;
 cout << "sqrt()*sqrt() = \n" << c2 << "\n";
 assert(dist(c2.Shift()-b.Shift()) < 1e-7);
 assert((c2.Warp()-b.Warp()).norm() < 1e-7);

 cout << "OK\n";
}



