vector.cpp

来自「本程序主要是设计了一个人工势能场机器人运动规划算法。并提出了一个新的斥力场函数。」· C++ 代码 · 共 43 行

CPP
43
字号
// Vector.cpp: implementation of the CVector class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Path.h"
#include "Vector.h"
#include "math.h"

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

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

CVector::~CVector()
{

}

CVector CVector::operator + (CVector &v)
{
	CVector temp;
	temp.x = x + v.x;
	temp.y = y + v.y;
	return temp;
}

void CVector::operator += (CVector &v)
{
	x = x + v.x;
	y = y + v.y;
}

void CVector::operator = (CVector &v)
{
	x = v.x;
	y = v.y;
}

⌨️ 快捷键说明

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