/* vector.C
 *
 * See vector.h for a class description.  This file contains the
 * implementation.
 */


#include "vector.h"
#include <iostream.h>


vector operator * ( float k, vector const& p )

{
  vector q;

  q.x = p.x * k;
  q.y = p.y * k;
  q.z = p.z * k;

  return q;
}


// I/O operators

ostream& operator << ( ostream& stream, vector const& p )

{
  stream << p.x << " " << p.y << " " << p.z;
  return stream;
}

istream& operator >> ( istream& stream, vector & p )

{
  stream >> p.x >> p.y >> p.z;
  return stream;
}


