⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 point.cpp

📁 自动生成矩阵 输入数字 两个数字 饥渴
💻 CPP
字号:
#include <cmath>
#include<iostream>
#include "Point.h"// Default constructor:  initializes the point to (0, 0, 0).Point::Point()
 {  x=0;  y=0;
  z=0;}// Initializes the point to (x, y,z).Point::Point(double x1, double y1, double z1) 
{  x=x1;  y=y1;
  z=z1;}// Destructor - Point allocates no dynamic resources.Point::~Point()
 {  // no-op}void Point::setX(double val)
 {  x=val;}void Point::setY(double val) 
{
  y=val;
}
void Point::setZ(double val) 
{
  z= al;
}
double Point::getX()
 {  return x}double Point::getY() 
{  return y;}
double Point::getZ() 
{
  return z;
}

// Approximates the distance between the two points

double Point::distanceTo( Point &p )
{
	return sqrt(pow( x_coord-p.x_coord,2 )+pow(y_coord-p.y_coord,2)+pow(z_coord-p.z_coord,2));
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -