Changeset 220 in pacpusframework for trunk/include


Ignore:
Timestamp:
Nov 13, 2013, 10:15:27 AM (11 years ago)
Author:
Marek Kurdej
Message:

Update: using directive.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/Pacpus/PacpusTools/geodesie.h

    r213 r220  
    190190void cartesianToPolar(const _T1 x, const _T1 y, _T2& r, _T2& theta)
    191191{
    192     r = std::sqrt(x * x + y * y);
    193     theta = std::atan2(x, y);
     192    using ::std::atan2;
     193    using ::std::sqrt;
     194
     195    r = sqrt(x * x + y * y);
     196    theta = atan2(x, y);
    194197}
    195198
     
    198201void polarToCartesian(const _T1 r, const _T1 theta, _T2& x, _T2& y)
    199202{
    200     x = r * std::cos(theta);
    201     y = r * std::sin(theta);
     203    using ::std::cos;
     204    using ::std::sin;
     205
     206    x = r * cos(theta);
     207    y = r * sin(theta);
    202208}
    203209
     
    207213void cartesianToSpherical(const _T1 x, const _T1 y, const _T1 z, _T2& r, _T2& theta, _T2& phi)
    208214{
    209     r = std::sqrt(x * x + y * y + z * z);
    210     theta = std::acos(z / r);
    211     phi = std::atan2(y, x);
     215    using ::std::acos;
     216    using ::std::atan2;
     217    using ::std::sqrt;
     218
     219    r = sqrt(x * x + y * y + z * z);
     220    theta = acos(z / r);
     221    phi = atan2(y, x);
    212222}
    213223
     
    217227void sphericalToCartesian(const _T1 r, const _T1 theta, const _T1 phi, _T2& x, _T2& y, _T2& z)
    218228{
    219     x = r * std::sin(theta) * std::cos(phi);
    220     y = r * std::sin(theta) * std::sin(phi);
    221     z = r * std::cos(theta);
     229    using ::std::cos;
     230    using ::std::sin;
     231
     232    x = r * sin(theta) * cos(phi);
     233    y = r * sin(theta) * sin(phi);
     234    z = r * cos(theta);
    222235}
    223236
Note: See TracChangeset for help on using the changeset viewer.