Skip to content
Snippets Groups Projects
Commit cd7ff960 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

camel case -> ZFrameVector

parent 6a3db026
No related branches found
No related tags found
1 merge request!1240change some fct names to camel case; rm sone unused fcts; relegate ad-hoc minus sign to vecOfLambdaAlphaPhi
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
R3 vecOfLambdaAlphaPhi(double _lambda, double _alpha, double _phi) R3 vecOfLambdaAlphaPhi(double _lambda, double _alpha, double _phi)
{ {
return Direction(_alpha, -_phi).zframe_vector(M_TWOPI / _lambda); return Direction(_alpha, -_phi).ZFrameVector(M_TWOPI / _lambda);
} }
R3 Direction::zframe_vector(double length) const R3 Direction::ZFrameVector(double length) const
{ {
return {length * std::cos(m_alpha) * std::cos(m_phi), return {length * std::cos(m_alpha) * std::cos(m_phi),
length * std::cos(m_alpha) * std::sin(m_phi), length * std::sin(m_alpha)}; length * std::cos(m_alpha) * std::sin(m_phi), length * std::sin(m_alpha)};
......
...@@ -36,7 +36,7 @@ public: ...@@ -36,7 +36,7 @@ public:
double phi() const { return m_phi; } double phi() const { return m_phi; }
//! Returns Cartesian 3D vector, in a frame where alpha=0 is on the +z axis. //! Returns Cartesian 3D vector, in a frame where alpha=0 is on the +z axis.
R3 zframe_vector(double length) const; R3 ZFrameVector(double length) const;
Direction zReflected() const { return {-m_alpha, m_phi}; } Direction zReflected() const { return {-m_alpha, m_phi}; }
......
...@@ -49,7 +49,7 @@ RectangularDetector* RectangularDetector::clone() const ...@@ -49,7 +49,7 @@ RectangularDetector* RectangularDetector::clone() const
void RectangularDetector::setDetectorNormal(const Direction& direction) void RectangularDetector::setDetectorNormal(const Direction& direction)
{ {
initNormalVector(direction.zframe_vector(1)); initNormalVector(direction.ZFrameVector(1));
initUandV(-direction.alpha()); initUandV(-direction.alpha());
} }
......
...@@ -37,7 +37,7 @@ RectangularConverterTest::RectangularConverterTest() ...@@ -37,7 +37,7 @@ RectangularConverterTest::RectangularConverterTest()
m_detector.setDetectorNormal(m_beam.direction().zReflected()); m_detector.setDetectorNormal(m_beam.direction().zReflected());
m_phi = std::atan2(det_width / 2.0, det_distance); m_phi = std::atan2(det_width / 2.0, det_distance);
m_alpha = std::atan2(det_height, det_distance / std::cos(m_phi)); m_alpha = std::atan2(det_height, det_distance / std::cos(m_phi));
const auto k_i = m_beam.direction().zframe_vector(M_TWOPI / m_beam.wavelength()); const auto k_i = m_beam.direction().ZFrameVector(M_TWOPI / m_beam.wavelength());
m_kiz = -k_i.z(); m_kiz = -k_i.z();
double K = 2.0 * M_PI / m_beam.wavelength(); double K = 2.0 * M_PI / m_beam.wavelength();
m_kfy = K * std::sin(m_phi); m_kfy = K * std::sin(m_phi);
......
...@@ -20,7 +20,7 @@ SphericalConverterTest::SphericalConverterTest() ...@@ -20,7 +20,7 @@ SphericalConverterTest::SphericalConverterTest()
: m_detector(100, 0.0, 5.0 * Units::deg, 70, -2.0 * Units::deg, 1.5) : m_detector(100, 0.0, 5.0 * Units::deg, 70, -2.0 * Units::deg, 1.5)
, m_beam(UnitBeam(1.0, 1 * Units::deg)) , m_beam(UnitBeam(1.0, 1 * Units::deg))
{ {
const auto k_i = m_beam.direction().zframe_vector(M_TWOPI / m_beam.wavelength()); const auto k_i = m_beam.direction().ZFrameVector(M_TWOPI / m_beam.wavelength());
m_kiz = -k_i.z(); m_kiz = -k_i.z();
const double K = 2.0 * M_PI / m_beam.wavelength(); const double K = 2.0 * M_PI / m_beam.wavelength();
m_kfy = K * std::sin(5.0 * Units::deg); m_kfy = K * std::sin(5.0 * Units::deg);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment