Commit 4d1ccd68 authored by Christof Metzger-Kraus's avatar Christof Metzger-Kraus
Browse files

fixing #166

parent 899d4f48
......@@ -325,14 +325,15 @@ void OpalBeamline::compute3DLattice() {
double rotationAngleAboutZ = bendElement->getRotationAboutZ();
Quaternion_t rotationAboutZ(cos(0.5 * rotationAngleAboutZ),
sin(0.5 * rotationAngleAboutZ) * Vector_t(0, 0, 1));
sin(-0.5 * rotationAngleAboutZ) * Vector_t(0, 0, 1));
Vector_t effectiveRotationAxis = rotationAboutZ.rotate(Vector_t(0, -1, 0));
effectiveRotationAxis /= euclidian_norm(effectiveRotationAxis);
Vector_t rotationAxis = rotationAboutZ.rotate(Vector_t(0, -1, 0));
rotationAxis /= euclidian_norm(rotationAxis);
Quaternion_t rotationAboutAxis(cos(0.5 * bendAngle),
sin(0.5 * bendAngle) * rotationAxis);
sin(0.5 * bendAngle) * effectiveRotationAxis);
Quaternion halfRotationAboutAxis(cos(0.25 * bendAngle),
sin(0.25 * bendAngle) * rotationAxis);
sin(0.25 * bendAngle) * effectiveRotationAxis);
double arcLength = (thisLength * std::abs(bendAngle) /
(2 * sin(bendAngle / 2)));
......@@ -340,7 +341,7 @@ void OpalBeamline::compute3DLattice() {
std::vector<Vector_t> truePath = bendElement->getDesignPath();
double entranceAngle = bendElement->getEntranceAngle();
Quaternion_t directionExitHardEdge(cos(0.5 * (0.5 * bendAngle - entranceAngle)),
sin(0.5 * (0.5 * bendAngle - entranceAngle)) * rotationAxis);
sin(0.5 * (0.5 * bendAngle - entranceAngle)) * effectiveRotationAxis);
Vector_t exitHardEdge = thisLength * directionExitHardEdge.rotate(Vector_t(0, 0, 1));
double distanceEntryHETruePath = euclidian_norm(truePath.front());
double distanceExitHETruePath = euclidian_norm(truePath.back() - exitHardEdge);
......@@ -356,7 +357,7 @@ void OpalBeamline::compute3DLattice() {
endPriorPathLength = beginThisPathLength + arcLength;
} else {
Quaternion rotation(1, 0, 0, 0);
// Quaternion rotation(1, 0, 0, 0);
// FieldList::iterator priorDipole = partiallyInsideDipole(it, elements_m.begin(), elements_m.end(), minOrder);
......@@ -382,7 +383,7 @@ void OpalBeamline::compute3DLattice() {
Quaternion_t rotationAboutZ(cos(0.5 * rotationAngleAboutZ),
sin(-0.5 * rotationAngleAboutZ) * Vector_t(0, 0, 1));
CoordinateSystemTrafo fromLastToThis(beginThis3D, rotationAboutZ * rotation);
CoordinateSystemTrafo fromLastToThis(beginThis3D, rotationAboutZ);// * rotation);
(*it).setCoordTransformationTo(fromLastToThis * currentCoordTrafo);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment