Header file for myVector2


/* The myVector2 class */

#ifndef _myvector2_h
#define _myvector2_h

#include "Vector2.h"

class myVector2: public Vector2
{

public:

   myVector2( double v0, double v1 ):Vector2(v0,v1){};

   myVector2 operator-( myVector2 V2 )
      { return myVector2( v[0]-V2.v[0], v[1]-V2.v[1] ); }

   myVector2 operator*( double d )
      { return myVector2( d * v[0], d * v[1] ); }

   double elem( int e ){ return v[e]; }

   friend double dot( myVector2, myVector2 );

};

inline double dot( myVector2 V1, myVector2 V2 )
{
   return V1.v[0] * V2.v[0] + V1.v[1] * V2.v[1];
}

#endif