21 #ifndef otbInverseLogPolarTransform_hxx
22 #define otbInverseLogPolarTransform_hxx
33 template <
class TScalarType>
45 template <
class TScalarType>
54 template <
class TScalarType>
57 m_Center[0] = parameters[0];
58 m_Center[1] = parameters[1];
59 m_Scale[0] = parameters[2];
60 m_Scale[1] = parameters[3];
61 otbMsgDebugMacro(<<
"Call To SetParameters: Center=" << m_Center <<
", Scale=" << m_Scale);
62 this->m_Parameters = parameters;
70 template <
class TScalarType>
74 this->m_Parameters[0] = m_Center[0];
75 this->m_Parameters[1] = m_Center[1];
76 this->m_Parameters[2] = m_Scale[0];
77 this->m_Parameters[3] = m_Scale[1];
79 return this->m_Parameters;
87 template <
class TScalarType>
91 double rho = std::sqrt(std::pow(point[0] - m_Center[0], 2) + std::pow(point[1] - m_Center[1], 2));
94 result[0] = (1. / m_Scale[0]) * std::asin((point[1] - m_Center[1]) / rho);
96 result[0] = result[0] * (180. /
CONST_PI);
98 result[0] = result[0] > 0. ? result[0] : result[0] + 360.;
100 if ((point[0] - m_Center[0]) >= 0)
102 result[0] = result[0] < 90. ? result[0] + 90. : result[0] - 90.;
104 result[1] = (1. / m_Scale[1]) * std::log(rho);
121 template <
class TScalarType>
125 double rho = std::sqrt(std::pow(vector[0] - m_Center[0], 2) + std::pow(vector[1] - m_Center[1], 2));
128 result[0] = (1 / m_Scale[0]) * std::asin((vector[1] - m_Center[1]) / rho);
130 result[0] = result[0] * (180 /
CONST_PI);
132 result[0] = result[0] > 0 ? result[0] : result[0] + 360;
134 if ((vector[0] - m_Center[0]) >= 0)
136 result[0] = result[0] < 90 ? result[0] + 90 : result[0] - 90;
138 result[1] = (1 / m_Scale[1]) * std::log(rho);
155 template <
class TScalarType>
160 double rho = std::sqrt(std::pow(vector[0], 2) + std::pow(vector[1], 2));
163 result[0] = (1 / m_Scale[0]) * std::asin((vector[1] - m_Center[1]) / rho);
165 result[0] = result[0] * (180 /
CONST_PI);
167 result[0] = result[0] > 0 ? result[0] : result[0] + 360;
169 if ((vector[0] - m_Center[0]) >= 0)
171 result[0] = result[0] < 90 ? result[0] + 90 : result[0] - 90;
173 result[1] = (1 / m_Scale[1]) * std::log(rho);
188 template <
class TScalarType>
191 Superclass::PrintSelf(os, indent);
192 os << indent <<
"Center: " << m_Center << std::endl;
193 os << indent <<
"Scale: " << m_Scale << std::endl;