template math functions in pimathmatrix.h and pimathvector.h and pimathbase.h

add PIMathMatrixT::rotate for matrix 2x2
This commit is contained in:
2020-10-22 17:29:58 +03:00
parent f5652efc32
commit fbe850abf0
4 changed files with 34 additions and 20 deletions

View File

@@ -69,7 +69,7 @@ public:
PIMV_FOR tv += c[i] * c[i];
return tv;
}
Type length() const {return sqrt(lengthSqr());}
Type length() const {return std::sqrt(lengthSqr());}
Type manhattanLength() const {
Type tv(0);
PIMV_FOR tv += piAbs<Type>(c[i]);
@@ -82,10 +82,10 @@ public:
}
Type angleSin(const _CVector & v) const {
Type tv = angleCos(v);
return sqrt(Type(1) - tv * tv);
return std::sqrt(Type(1) - tv * tv);
}
Type angleRad(const _CVector & v) const {return acos(angleCos(v));}
Type angleDeg(const _CVector & v) const {return toDeg(angleRad(v));}
Type angleRad(const _CVector & v) const {return std::acos(angleCos(v));}
Type angleDeg(const _CVector & v) const {return toDeg<Type>(angleRad(v));}
Type angleElevation(const _CVector & v) const {return 90.0 - angleDeg(v - *this);}
_CVector projection(const _CVector & v) {
Type tv = v.length();
@@ -302,7 +302,7 @@ public:
PIMV_FOR tv += c[i] * c[i];
return tv;
}
Type length() const {return sqrt(lengthSqr());}
Type length() const {return std::sqrt(lengthSqr());}
Type manhattanLength() const {
Type tv(0);
PIMV_FOR tv += piAbs<Type>(c[i]);
@@ -317,9 +317,9 @@ public:
Type angleSin(const _CVector & v) const {
assert(c.size() == v.size());
Type tv = angleCos(v);
return sqrt(Type(1) - tv * tv);
return std::sqrt(Type(1) - tv * tv);
}
Type angleRad(const _CVector & v) const {return acos(angleCos(v));}
Type angleRad(const _CVector & v) const {return std::acos(angleCos(v));}
Type angleDeg(const _CVector & v) const {return toDeg(angleRad(v));}
_CVector projection(const _CVector & v) {
assert(c.size() == v.size());