本文整理汇总了C++中Point::MultS方法的典型用法代码示例。如果您正苦于以下问题:C++ Point::MultS方法的具体用法?C++ Point::MultS怎么用?C++ Point::MultS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point
的用法示例。
在下文中一共展示了Point::MultS方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: calc_average_straight_line
void Gerade::calc_average_straight_line(list<Point>& KooL)
{
if(KooL.size()>2)
{
Point Koo_Schw;
//Schwerpunktberechnung
double sum_x=0,sum_y=0,sum_z=0;
list<Point>::iterator iKooL = KooL.begin();
while(iKooL!=KooL.end())
{
sum_x+=iKooL->get_X();
sum_y+=iKooL->get_Y();
sum_z+=iKooL->get_Z();
++iKooL;
}
Koo_Schw.set_X(sum_x/KooL.size());
Koo_Schw.set_Y(sum_y/KooL.size());
Koo_Schw.set_Z(sum_z/KooL.size());
//END
Matrix A(static_cast<int>(KooL.size()),3,Empty);
iKooL = KooL.begin();
int i=0;
while(iKooL != KooL.end())
{
A(i,0)=iKooL->get_X() - Koo_Schw.get_X();
A(i,1)=iKooL->get_Y() - Koo_Schw.get_Y();
A(i,2)=iKooL->get_Z() - Koo_Schw.get_Z();
++i;
++iKooL;
}
Matrix Q = A.MatTrans().MatMult(A);
//Matrix ew;
Matrix Ev = Q.MatEigVek();//ew
//Point KooEv;
//KooEv.set_X(Ev(0,0));
//KooEv.set_Y(Ev(1,0));
//KooEv.set_Z(Ev(2,0));
Point KooEv;
KooEv.set_X(Ev(0,2));
KooEv.set_Y(Ev(1,2));
KooEv.set_Z(Ev(2,2));
//test
//double d;
//direction angle
if( KooEv.get_X()<0.0 && KooEv.get_Y()<0.0 && KooEv.get_Z() == 0.0)
KooEv=KooEv.MultS(-1.0);
(*this).set_O_R(Koo_Schw,KooEv);
//m_d=KooEv.Mult(Koo_Schw)*(-1.0);//change problems
//m_d=KooEv.Mult(Koo_Schw)*(-1.0);//change problems
//m_d = (Point(sum_x/KooL.size(),sum_y/KooL.size(),sum_z/KooL.size()).Mult(KooEv))/KooL.size();
//cout<<endl<<"d_alt:"<<m_d<<"d_neu: "<<d<<flush;
}
else
throw EX("list size error",DEBUG_LOCATION,"Gerade::calc_average_straight_line(list<Point>& KooL) -> size of the \"Point\" list is to small (size > 2) -> error");
}