本文整理汇总了C++中MathVector::size方法的典型用法代码示例。如果您正苦于以下问题:C++ MathVector::size方法的具体用法?C++ MathVector::size怎么用?C++ MathVector::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MathVector
的用法示例。
在下文中一共展示了MathVector::size方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: temp
// overloaded multiplication of matrix by a vector
MathVector MathMatrix::operator*(const MathVector& v) const
{
if (n != v.size()) { throw "Matrix and Vector do not"; }
//Create matrix object of the correct size to hold the resulting matrix from multiplication
MathVector temp(v.size());
//Go across the rows of the matrix the method was called on
for (int i=0; i<nrows; i++)
{
//Declare empty variable to hold the multiplication result
double sum = 0;
//Go across the columns on the matrix that was passed as a parameter
for (int j=0; j<ncols; j++)
{
sum+=(*this)(i, j) * v[0];
}
//Set element in temp at the corresponding loop iteration index to the result
temp[i] = sum;
}
return temp;
}
示例2: normal
MathVector Math::normal(MathVector a, MathVector b, MathVector c)
{
MathVector r1;
MathVector r2;
MathVector output;
r2=c-b;
r1=b-a;
output = r1.cross(r2);
output=(1.0f/output.size())*output;
return output;
}
示例3: MathVector
Quat Math::rot2Quat( MathVector in)
{
MathVector inv = in;
Quat nq;
double invs;
double phi;
MathVector unitV;
invs = inv.size();
if(invs != 0)
{
unitV = 1/invs * inv ;
}
else
{
unitV = MathVector(1,0,0);
}
phi = invs * 3.14159265/180;
nq.v = sin(phi/2) * unitV;
nq.scale = cos(phi/2);
return nq;
}
示例4: distance
double Math::distance(MathVector a, MathVector b)
{
MathVector delta = a - b;
return delta.size();
}
示例5: size
double Math::size(MathVector in)
{
return in.size();
}