[Error] must take either zero or one argument
代码如下
#include<bits/stdc++.h>
#ifndef vectin2_h
#define vectin2_h
using namespace std;
class vectin2{
private:
public:
double x;double y;
double Mode,Tan;
vectin2(double alpha,double beta):
x(alpha),y(beta){
Mode=sqrt(alpha+beta);
Tan=beta/alpha;
}
vectin2 operator +(vectin2 a,vectin2 b){
vectin2 ve_;
ve_.x=a.x+b.x,ve_y=a.y+b.y;
return ve_;
}
vectin2 operator -(vectin2 a,vectin2 b){
vectin2 ve_;
ve_.x=a.x-b.x,ve_y=a.y-b.y;
return ve_;
}
double operator *(vectin2 a,vectin2 b){
return a.x*b.x+a.y+b.y;
}//点乘
double operator *(vectin2 a,vectin2 b,double theta){
return a.Mode*b.Mode*cos(theta);
}//点乘
void operator =(vectin2 a) {
this->x=a.x,
this->y=a.y;
}
};
#endif