www.pudn.com > 1012.zip > Point3d.cpp


// Point3d.cpp: implementation of the CPoint3d class. 
// 
////////////////////////////////////////////////////////////////////// 
 
#include "stdafx.h" 
#include "SCAD.h" 
#include "Point3d.h" 
#include  
#ifdef _DEBUG 
#undef THIS_FILE 
static char THIS_FILE[]=__FILE__; 
#define new DEBUG_NEW 
#endif 
 
////////////////////////////////////////////////////////////////////// 
// Construction/Destruction 
////////////////////////////////////////////////////////////////////// 
 
CPoint3d::CPoint3d() 
{ 
	x = y = z= 0.0; 
} 
 
CPoint3d::~CPoint3d() 
{ 
 
} 
 
void CPoint3d::Set(double dx, double dy, double dz) 
{ 
	x = dx; 
	y = dy; 
	z = dz; 
} 
 
 
double CPoint3d::DistanceTo(const CPoint3d &pt) 
{ 
 	double xx = x - pt.x; 
	double yy = y - pt.y; 
 	return sqrt(xx*xx + yy*yy); 
}