mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 22:20:04 +00:00 
			
		
		
		
	Add GetRadarBeamAltititude into geographic lib
This commit is contained in:
		
							parent
							
								
									22ed4c36fc
								
							
						
					
					
						commit
						b84c36c91a
					
				
					 2 changed files with 35 additions and 0 deletions
				
			
		|  | @ -2,6 +2,7 @@ | |||
| #include <scwx/util/logger.hpp> | ||||
| 
 | ||||
| #include <numbers> | ||||
| #include <cmath> | ||||
| 
 | ||||
| #include <GeographicLib/Gnomonic.hpp> | ||||
| #include <geos/algorithm/PointLocation.h> | ||||
|  | @ -289,6 +290,25 @@ bool AreaInRangeOfPoint(const std::vector<common::Coordinate>& area, | |||
|     return GetDistanceAreaPoint(area, point) <= distance; | ||||
| } | ||||
| 
 | ||||
| units::length::meters<double> | ||||
| GetRadarBeamAltititude(units::length::meters<double> range, | ||||
|                        units::angle::degrees<double> elevation, | ||||
|                        units::length::meters<double> height) | ||||
| { | ||||
|    static const units::length::meters<double> earthRadius {6367444 * 4/3}; | ||||
| 
 | ||||
|    height += earthRadius; | ||||
| 
 | ||||
|    const double elevationRadians = | ||||
|       units::angle::radians<double>(elevation).value(); | ||||
|    const auto altitudeSquared = | ||||
|       (range * range + height * height + | ||||
|        2 * range * height * std::sin(elevationRadians)); | ||||
| 
 | ||||
|    return units::length::meters<double>(std::sqrt(altitudeSquared.value())) - | ||||
|           earthRadius; | ||||
| } | ||||
| 
 | ||||
| } // namespace GeographicLib
 | ||||
| } // namespace util
 | ||||
| } // namespace qt
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 AdenKoperczak
						AdenKoperczak