/* 
 * Thomas Pantzer: t_vector.h, v0.1b  8.6.99 16:49 
 * 
 * 
 * Copyright 1999 by Thomas Pantzer
 * 
 * Permission to use, copy, modify, and distribute this software for noncommercial 
 * use and without fee is hereby granted, provided that the above copyright notice 
 * appear in all copies and that both that copyright notice and this permission 
 * notice appear in supporting documentation, and that the name of the Author not be 
 * used in advertising or publicity pertaining to distribution of the software 
 * without specific, written prior permission. The Author makes no representations about
 * the suitability of this software for any purpose.  It is provided "as is" 
 * without expressed or implied warranty. 
 * 
 * 
 * pantec@isys2.informatik.uni-leipzig.de   (Thomas Pantzer) 
 * 
 */


#ifndef T_VECTOR_H
#define T_VECTOR_H

#define SQR(x)		fabs(fabs(x) * fabs(x))


class t_vector {
public:
	double x,y;

	void Init(t_vector &);
	void Init(double nx,double ny);

	void Normalize(void);
	void Add(t_vector *);
	void Sub(t_vector *);
	void Mult(double);
	double Scalar(t_vector *);
	double Length(void);
	double Distance(t_vector *);
	double CosPhi(t_vector *);
	void Rotate(double);

	t_vector* operator += (class t_vector *a)  { Add(a);  return this; };                         
	t_vector* operator -= (class t_vector *a)  { Sub(a);  return this; };                         
	t_vector* operator *= (double d)           { Mult(d); return this; };                         

	double operator * (class t_vector *a) {return Scalar(a); };
};


#endif







/**/
/**/
/**/
/**/
/**/
/**/
/**/
/**/
/*****  End Of File  ****************************/
