vehicle.cpp 437 B

1234567891011121314151617
  1. //#if 0
  2. #include "vehicle.h"
  3. Point cartoworld(Point P, CarState car)
  4. {
  5. Point ins;
  6. double x_vehicle, y_vehicle;
  7. double theta = atan2(P.x, P.y);
  8. double distance = sqrt(P.x * P.x + P.y * P.y);
  9. double angle = (car.ins_heading_angle / 180 * PI + theta);
  10. x_vehicle = car.x + distance * sin(angle);
  11. y_vehicle = car.y + distance * cos(angle);
  12. ins.x = x_vehicle;
  13. ins.y = y_vehicle;
  14. return ins;
  15. }
  16. //#endif