Describe the bug
During our academic research on automated physical unit consistency and dimensional analysis in C/C++ projects, we identified a critical mathematical and unit-mismatch bug in the local spherical projection calculations within geo.cpp.
- Unit Mismatch (Deg vs Rad): The
<cmath> function cos() strictly expects radians, but lat_now is passed directly in degrees.
- Formula Inversion (Spherical Geometry): The latitude scaling incorrectly applies the cosine projection, while the longitude scaling entirely misses it.
Location
src/lib/geo/geo.cpp (around line 343)
double lon_start = lon_now + start_disp_x / 111111.0;
double lat_start = lat_now + start_disp_y * cos(lat_now) / 111111.0;
Flight Log / Additional Information
This issue was automatically flagged by our experimental LLM-assisted dimensional analysis tool and manuallyverified.
Describe the bug
During our academic research on automated physical unit consistency and dimensional analysis in C/C++ projects, we identified a critical mathematical and unit-mismatch bug in the local spherical projection calculations within
geo.cpp.<cmath>functioncos()strictly expects radians, butlat_nowis passed directly in degrees.Location
src/lib/geo/geo.cpp(around line 343)double lon_start = lon_now + start_disp_x / 111111.0;
double lat_start = lat_now + start_disp_y * cos(lat_now) / 111111.0;
Flight Log / Additional Information
This issue was automatically flagged by our experimental LLM-assisted dimensional analysis tool and manuallyverified.