error of what?

please tell me what's the mean of erros
56 C:\Dev-Cpp\vfh\vfh.cpp invalid types `double*[double]' for array subscript
56 C:\Dev-Cpp\vfh\vfh.cpp no matching function for call to `atan2(double)'
note C:\Dev-Cpp\include\math.h:146 candidates are: double atan2(double,
double)
note C:\Dev-Cpp\include\math.h:146 candidates are: double atan2(double,
double)
note C:\Dev-Cpp\include\math.h:146 long double std::atan2
(long double, long double)
note C:\Dev-Cpp\include\math.h:146 float std::atan2(float, float)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
void compute_cell(double sector_angle, double cell_size, std::vector<double> &hist, 
                  std::vector<std::vector<double> > &cert_value)
{
   double WS = 33;  
   double center_x = (WS - 1) / 2;
   double center_y = center_x;
   double x, y, i;
   
   sector_angle = 5;
   cell_size = 0.1;
      
   int hist_size = 360 / sector_angle;
   double *cell_mag;
   double *cell_dis;
   double *cell_dir;
   
   for(i = 0 ; i < hist_size; i++)
   {  hist[i] = 0;
         }
         
   for(x = 0; x < WS; x++)
    { for(y = 0; y < WS; y++)
       {  cert_value[x][y] = 0;
          cell_dir[x][y] = atan2((y - center_y) / (x - center_x));
          }}
}
Last edited on
Line 24: cell_dir is a double *, but here it's being used as a double **. Even worse, cell_dir is uninitialized. atan2() takes two parameters. Judging from the call, I'd say you meant to use atan().
Topic archived. No new replies allowed.