blob: 2f2da299c704805da459bbd8bf57b39818a3d046 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#include <GProp.ixx>
#include <Standard_DimensionError.hxx>
#include <gp.hxx>
#include <gp_XYZ.hxx>
void GProp::HOperator (
const gp_Pnt& G,
const gp_Pnt& Q,
const Standard_Real Mass,
gp_Mat& Operator
) {
gp_XYZ QG = G.XYZ() - Q.XYZ();
Standard_Real Ixx = QG.Y() * QG.Y() + QG.Z() * QG.Z();
Standard_Real Iyy = QG.X() * QG.X() + QG.Z() * QG.Z();
Standard_Real Izz = QG.Y() * QG.Y() + QG.X() * QG.X();
Standard_Real Ixy = - QG.X() * QG.Y();
Standard_Real Iyz = - QG.Y() * QG.Z();
Standard_Real Ixz = - QG.X() * QG.Z();
Operator.SetCols (gp_XYZ (Ixx, Ixy, Ixz), gp_XYZ (Ixy, Iyy, Iyz),
gp_XYZ (Ixz, Iyz, Izz));
Operator.Multiply (Mass);
}
|