[ create a new paste ] login | about

Link: http://codepad.org/OgNBvJhD    [ raw code | output | fork ]

C, pasted on Feb 18:
#include <stdio.h>
#include <math.h>

//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//


#define PI 3.141592

#define NUMBER_OF_PARTICLES 100

double xArray[NUMBER_OF_PARTICLES];
double yArray[NUMBER_OF_PARTICLES];
double thetaArray[NUMBER_OF_PARTICLES];
double weightArray[NUMBER_OF_PARTICLES];
double avgXarray;
double avgYarray;
double avgTheta;


void navigateToWaypoint ( int x, int y)
{

 double distance  =  sqrt ( (avgYarray-y)*(avgYarray-y) + (avgXarray-x)*(avgXarray-x));

      xArray[0] = xArray[0] + (distance + 1 )* cos(thetaArray[0] );
      yArray[0] = yArray[0] + (distance+1 ) * sin(thetaArray[0] );

}

int main() {


}


Output:
1
2
3
In function `navigateToWaypoint':
undefined reference to `cos'
undefined reference to `sin'


Create a new paste based on this one


Comments: