59 static const G4double kMatrixPrecision = 10E-10;
60 const G4double cosb = std::sqrt(mtx.xx()*mtx.xx()+mtx.yx()*mtx.yx());
62 if (cosb > kMatrixPrecision)
64 x = std::atan2(mtx.zy(),mtx.zz());
65 y = std::atan2(-mtx.zx(),cosb);
66 z = std::atan2(mtx.yx(),mtx.xx());
70 x = std::atan2(-mtx.yz(),mtx.yy());
71 y = std::atan2(-mtx.zx(),cosb);
89 xercesc::DOMElement* scaleElement =
NewElement(tag);
90 scaleElement->setAttributeNode(
NewAttribute(
"name",name));
94 element->appendChild(scaleElement);
105 xercesc::DOMElement* rotationElement =
NewElement(tag);
106 rotationElement->setAttributeNode(
NewAttribute(
"name",name));
110 rotationElement->setAttributeNode(
NewAttribute(
"unit",
"deg"));
111 element->appendChild(rotationElement);
122 xercesc::DOMElement* positionElement =
NewElement(tag);
123 positionElement->setAttributeNode(
NewAttribute(
"name",name));
127 positionElement->setAttributeNode(
NewAttribute(
"unit",
"mm"));
128 element->appendChild(positionElement);
static const G4double kAngularPrecision
void Scale_vectorWrite(xercesc::DOMElement *, const G4String &, const G4String &, const G4ThreeVector &)
static constexpr double mm
CLHEP::Hep3Vector G4ThreeVector
CLHEP::HepRotation G4RotationMatrix
xercesc::DOMElement * defineElement
const char * name(G4int ptype)
xercesc::DOMElement * NewElement(const G4String &)
void Position_vectorWrite(xercesc::DOMElement *, const G4String &, const G4String &, const G4ThreeVector &)
virtual void DefineWrite(xercesc::DOMElement *)
G4GLOB_DLL std::ostream G4cout
static constexpr double degree
static const G4double kRelativePrecision
xercesc::DOMAttr * NewAttribute(const G4String &, const G4String &)
static const G4double kLinearPrecision
G4ThreeVector GetAngles(const G4RotationMatrix &)
void Rotation_vectorWrite(xercesc::DOMElement *, const G4String &, const G4String &, const G4ThreeVector &)
virtual ~G4GDMLWriteDefine()
static const G4double pos