
#include <print.h>
#include <mathlib.h>

#include <d2simplex.h>

#include <d2homogeneous.h>

void d2simplex::translate( pt2c & x )
{
  for (uint i=0; i<3; ++i)
    v[i] += x; 
}


void d2simplex::rotate(doublec theta)
{
  point2<double> c(v[0]);
  c += v[1];
  c += v[2];
  c *= (1.0/3.0);

  d2homogeneous R;

  R.setRotateAboutPoint(theta,c);

  for (uint i=0; i<3; ++i)
    R.matrixMultiply(v[i]);

/*
  double const cos_t = cos(theta);
  double const sin_t = sin(theta);

  pt2c r1(cos_t,-sin_t);
  pt2c r2(sin_t,cos_t);

  pt2 z;
  for (uint i=0; i<3; ++i)
  {
    z.x = r1.dot(v[i]);
    z.y = r2.dot(v[i]);
    v[i] = z;
  }
*/


}
















