/*
 * Jeffrey Ladino - jnl22@ccs.neu.edu
 *
 * File: point2d.cpp
 *
 * Change Log
 ************
 ** July 26, 1999 - Jeff Ladino
 * Created.
 *
 */

#include "point2d.h"
#include <stdio.h>

point2d::point2d(Real x, Real y){
  point[0] = x;
  point[1] = y;
  point[2] = 1.0;
}

point2d::point2d(vector3d v){
  point[0] = v[0];
  point[1] = v[1];
  point[2] = v[2]; // maybe I should force to 1??
}

void point2d::draw(SimpleDraw& sd, matrix3d m){
//void point2d::draw(matrix3d m){
  vector3d plot = m * point;
  printf("plotting (%e, %e)\n", plot[0], plot[1]);
  sd.DrawPoint((int)plot[0], (int)plot[1]);
  sd.DrawPoint((int)plot[0]+1, (int)plot[1]);
  sd.DrawPoint((int)plot[0]+2, (int)plot[1]);
  sd.DrawPoint((int)plot[0], (int)plot[1]+1);
  sd.DrawPoint((int)plot[0]+1, (int)plot[1]+1);
  sd.DrawPoint((int)plot[0]+2, (int)plot[1]+2);
}

void point2d::print(){
  for(int i=0;i<3;i++)
    printf("point[%d] = %e\n", i, point[i]);
}







