Changeset 1005 for cpp/common/Convert.h
- Timestamp:
- 07/14/20 15:54:43 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/Convert.h
r913 r1005 11 11 #include "2d.h" 12 12 #include <stdint.h> 13 #include <cmath> 13 14 14 15 … … 39 40 static uint32_t hexToInt(const string& col); 40 41 41 static double toRadians(double angle) { return angle *M_PI / 180; }42 static double toRadians(double angle) { return angle * M_PI / 180; } 42 43 static double toDegrees(double angle) { return angle / M_PI * 180; } 43 44 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? … … 46 47 { 47 48 double dx = x2 - x1, dy = y2 - y1; 48 return dx *dx + dy*dy;49 return dx * dx + dy * dy; 49 50 } 50 51 static double odleglosc_sq(const Pt2D& p1, const Pt2D& p2) //odleglosc do kwadratu … … 53 54 } 54 55 55 static double odleglosc(double x1, double y1, double x2, double y2) 56 static double odleglosc(double x1, double y1, double x2, double y2) { return sqrt(odleglosc_sq(x1, y1, x2, y2)); } 56 57 static double odleglosc(const Pt2D& p1, const Pt2D& p2) 57 58 {
Note: See TracChangeset
for help on using the changeset viewer.