⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 polar.c

📁 NIST Handwriting OCR Testbed
💻 C
字号:
/*# proc: to_rel_polar2 - converts a list of cartesian points indirectly # proc:                 referenced through an index list to polar coordinates# proc:                 relative to a specified center point.*/#include <math.h>/***************************************************************************/to_rel_polar2(lr, lt, px, py, lx, ly, end, inbox, inbox_i)float *lr, *lt;int px, py, *lx, *ly, end, *inbox, inbox_i;{   float x, y, t;   int i;   for(i = 0; i < inbox_i; i++){      x = (float)(px - lx[inbox[i]]);      y = (float)(py - ly[inbox[i]]);      lr[i] = (float)sqrt((double)((x*x)+(y*y)));      if(x != 0.0)         t = (float)atan2((double)(y), (double)(x));      else{         if(ly[inbox[i]] > py)            t = M_PI/2.0;         else            t = M_PI/-2.0;      }      if(t > (M_PI/2.0))         lt[i] = t - M_PI;      else{         if(t < (M_PI/-2.0))            lt[i] = t + M_PI;         else            lt[i] = t;      }   }      }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -