Changeset 185


Ignore:
Timestamp:
03/19/14 00:14:52 (11 years ago)
Author:
Maciej Komosinski
Message:

Avoid "atan2: domain error"

Location:
cpp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpp/common/Convert.h

    r122 r185  
    3333  static double toRadians(double kat) {return kat*M_PI/180;}
    3434  static double toDegrees(double kat) {return kat/M_PI*180;}
    35   static double atan_2(double y,double x) {if (x==0 && y==0) return 0; else return atan2(y,x);}
     35  static double atan_2(double y,double x) {if (x==0 && y==0) return 0; else return atan2(y,x);} //needed by borland 5/6 only?
    3636
    3737        static double odleglosc_sq(double x1,double y1,double x2,double y2) //odleglosc do kwadratu, wystarczy do porownywania
     
    7575
    7676
    77 
    7877#endif
  • cpp/frams/genetics/fF/conv_fF.cpp

    r178 r185  
    77#include <frams/model/model.h>
    88#include <common/nonstd_stl.h>
     9#include <common/Convert.h>
    910
    1011GenoConv_fF0::GenoConv_fF0()
     
    126127                double angle;
    127128
    128                 angle = atan2(pzyprim, pzxprim);
     129                angle = Convert::atan_2(pzyprim, pzxprim);
    129130                double alpha = angle - alpha_;
    130131
Note: See TracChangeset for help on using the changeset viewer.