2017年伊豆大島共同打ち上げ実験用電装モジュール搭載GPS測位プログラム
Dependents: Hybrid_interruptGPS Hybrid_main_FirstEdtion rocket_logger_sinkan2018_v1 HYBRYD2018_IZU_ROCKET ... more
Diff: GPS_interrupt.cpp
- Revision:
- 12:935b21d30ec2
- Parent:
- 11:1897b52fa8a1
- Child:
- 14:23611bb30bc8
--- a/GPS_interrupt.cpp Sat Nov 25 07:00:51 2017 +0000 +++ b/GPS_interrupt.cpp Sun Feb 25 03:22:16 2018 +0000 @@ -341,7 +341,7 @@ seconds = atof(zikann);//sec = 233514.000 hour = (int)(seconds / 10000.0); //233514/10000=(int)23 minutes = (seconds - hour * 10000) / 100;//233514.0-230000=3514.0,3514.0/100=35 - seconds = seconds - ((double)minutes * 100.0 + (double)hour * 10000.0); + seconds = seconds - ((float)minutes * 100.0 + (float)hour * 10000.0); // getLonLatのとき有効 Y_m = atof(ido);//*Y_m = 3457.5571 @@ -360,6 +360,7 @@ if (latSign) latitude *= (-1);//南緯なら緯度を負に knot = atof(speed); degree = atof(angle); + if(longitude > 100.0 && longitude < 150.0 && latitude > 30.0 && latitude < 50.0){ return true; } @@ -488,7 +489,7 @@ return false; } -double GPS_interrupt::Distance(double x, double y){ +float GPS_interrupt::Distance(double x, double y){ double dLat = x - longitude;//相対経度 double dLng = y - latitude;//相対緯度 @@ -507,5 +508,5 @@ dLat *= arc_lat; dLng *= arc_lng; - return sqrt(dLat * dLat + dLng * dLng); + return (float)sqrt(dLat * dLat + dLng * dLng); }