//-*-c++-*-
#ifndef Tulip_COORD_H
#define Tulip_COORD_H
///
class Coord
{
  friend Coord operator +(const Coord &c1,const Coord &c2);
  friend Coord operator -(const Coord &c1,const Coord &c2);
  friend Coord operator ^(const Coord &c1,const Coord &c2);
  friend Coord operator /(const Coord &c1,const float scalaire);
  friend Coord operator *(const Coord &c1,const float scalaire);
  friend float operator*(const Coord &c1,const Coord &c2);

private:
  float v[3];
public:
  Coord(const float=0,const float=0,const float=0);
  ///
  void set(const float=0,const float=0,const float=0);
  ///
  void set(const Coord&);
  ///
  void setX(float);
  ///
  void setY(float);
  ///
  void setZ(float);
  ///
  float getX() const {return v[0];}
  ///
  float getY() const {return v[1];}
  ///
  float getZ() const {return v[2];}
  ///
  float norm() const;
  ///
  float dist(const Coord&) const;
  ///
  Coord & operator *=(const Coord&);
  ///
  Coord & operator *=(const float);
  ///
  Coord & operator /=(const Coord&);
  ///
  Coord & operator /=(const float);
  ///
  Coord & operator -=(const Coord&);
  ///
  Coord & operator -=(const float);
  ///
  Coord & operator +=(const Coord&);
  ///
  Coord & operator +=(const float);
  ///
  void get(float &, float &, float &) const;
  ///
  bool operator ==(const Coord &) const;
  //
  bool operator !=(const Coord &) const;
  //
  float& operator[](const unsigned int);
  //
  float operator[](const unsigned int) const;
};

Coord operator +(const Coord &c1,const Coord &c2);
Coord operator -(const Coord &c1,const Coord &c2);
Coord operator ^(const Coord &c1,const Coord &c2);
Coord operator /(const Coord &coord,const float scalaire);
Coord operator *(const Coord &coord,const float scalaire);
float operator *(const Coord &c1,const Coord &c2);
#endif
