myVector2 example program


/*

Example of using the myVector2 class
derived from Vector2 class

*/

#include "myVector2.h"
#include "stream.h"

int main( int argc, char **argv )
{

   myVector2 c1 = myVector2(1.0,2.5);
   myVector2 c2 = myVector2(3.0,1.0);
   myVector2 c3 = myVector2(-2.5,2.0);

   cout << c3 - c3 * dot(c1,c2) + c1 * 3 << endl;

   cout << '(' << c1.elem(0) << ',' <<
                  c1.elem(1) << ')' << endl;

   return 0;

}


Output:
(14.25,-1.5)
(1,2.5)