// Vorosweep - Copyright (C) 2010-2014 T. Mouton
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <thibaud.mouton@gmail.com>.

#include <math.h>
#include "common.h"

#ifndef _ELEMENTARY_INCLUDE
#define _ELEMENTARY_INCLUDE

namespace vorosweep
{

class Point
{
  public:
    double p[3];
    int index;
  public:
    Point()
    {
      p[0] = p[1] = p[2] = 0.0;
      index = -1;
    }
    inline void set ( double *pt )
    {
      p[0] = pt[0];
      p[1] = pt[1];
      p[2] = pt[2];
    }
    inline void set ( double x, double y, double z )
    {
      p[0] = x;
      p[1] = y;
      p[2] = z;
    }
    inline void set_index(int i)
    {
      index = i;
    }
    inline int get_index()
    {
      return index;
    }
//     Point ( double *pt )
//     {
//       p[0] = pt[0];
//       p[1] = pt[1];
//       p[2] = pt[2];
// //       p[2] = 0.0;
//     }
//     Point ( double x, double y )
//     {
//       p[0] = x;
//       p[1] = y;
//       p[2] = 0.0;
//     }
};

class matrix
{
public:
  double m[3];
  double angle;
  double cosa;
  double sina;
  double v[2];
public:
  matrix(double ang, double v1, double v2)
  {
    angle = ang;
    cosa = cos(angle);
    sina = sin(angle);
    v[0] = v1;
    v[1] = v2;
    
    m[0] = (sina*sina)/(v2*v2)+(cosa*cosa)/(v1*v1);
    m[1] = cosa*sina/(v1*v1)-cosa*sina/(v2*v2);
    m[2] = (cosa*cosa)/(v2*v2)+(sina*sina)/(v1*v1);
    
//     printf("new matrix --> av : %lf %lf %lf / m : %lf %lf %lf\n", angle, v[0], v[1], m[0], m[1], m[2]);
  }
};

};

#endif
