Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
21
Добавлен:
16.04.2013
Размер:
830 б
Скачать
// Spline.cpp: implementation of the Spline class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Spline_2d.h"
#include "Spline.h"
#include <math.h>

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

Spline::Spline(int PtNum, CPoint Center)
{
 PointCoordX = new int[PtNum];

	for(int i=0; i<PtNum; i++)
 {
	*(PointCoordX +i) = Center.x + 150*cos(2*pi*i/PtNum);
 	*(PointCoordY +i) = Center.y + 150*sin(2*pi*i/PtNum);
 }
}

Spline::~Spline()
{
  if(PointCoordX) delete PointCoordX;
  if(PointCoordY) delete PointCoordY;
}
Соседние файлы в папке Spline_2d