diff --git a/Classes/Angle.cls b/Classes/Angle.cls index 9642093..1461cf3 100644 --- a/Classes/Angle.cls +++ b/Classes/Angle.cls @@ -183,14 +183,18 @@ Public Property Let Dir(ByVal Value As String) Dim ac As Integer: ac = AscW(Value) If m_Dir = Value Then Select Case ac - Case 73, 87: m_Dir = Value 'S 'W + Case 83, 87: m_Dir = Value 'S 'W If Sgn(m_angle) > 0 Then m_angle = -1 * m_angle 'eigentlich müßte man den Winkel auch mod 180 machen, damit der Betrag des Winkels nicht größer als 180 wird End Select Else Select Case ac - Case 78, 68, 79: m_Dir = Value 'N 'E or O - Case 73, 87: m_Dir = Value 'S 'W + Case 78, 69, 79: 'N 'E or O + If Not (m_Dir = "O" And ac = 69) Then + 'leave "O" as it is ;-) + m_Dir = Value + End If + Case 83, 87: m_Dir = Value 'S 'W If Sgn(m_angle) > 0 Then m_angle = -1 * m_angle End Select End If diff --git a/Classes/GeoPos.cls b/Classes/GeoPos.cls index abba5f7..4252cce 100644 --- a/Classes/GeoPos.cls +++ b/Classes/GeoPos.cls @@ -60,7 +60,7 @@ Public Sub Parse(s As String) If i <= u Then m_Height = CDbl(sa(i)): i = i + 1 If i <= u Then m_Name = sa(i): i = i + 1 If m_Lat.Value < 0 Then m_Lat.Dir = "S" Else m_Lat.Dir = "N" - If m_Lon.Value < 0 Then m_Lon.Dir = "W" Else m_Lat.Dir = "E" + If m_Lon.Value < 0 Then m_Lon.Dir = "W" Else m_Lon.Dir = "E" End Sub Public Function HaverSineDistanceTo(other As GeoPos) As Double diff --git a/Forms/Form1.frm b/Forms/Form1.frm index b617769..7d2af04 100644 --- a/Forms/Form1.frm +++ b/Forms/Form1.frm @@ -153,6 +153,8 @@ Sub UpdateView() End Sub Private Sub LBFamousPlaces_Click() + Dim s As String: s = LBFamousPlaces.Text + If Len(s) = 0 Then Exit Sub Dim gps As GeoPos: Set gps = MNew.GeoPosS(LBFamousPlaces.Text) Dim utm As UTM32: Set utm = gps.ToUTM32(MUTM.Ellipsoids(22)) 'the ellipsoid WGS-84 TxtResults.Text = utm.ToStr & vbCrLf & gps.ToStr & vbCrLf & gps.ToStrKml & vbCrLf & gps.ToKoUmrLink diff --git a/PAngleWGS84UTM32.vbp b/PAngleWGS84UTM32.vbp index 221604d..1376133 100644 --- a/PAngleWGS84UTM32.vbp +++ b/PAngleWGS84UTM32.vbp @@ -21,7 +21,7 @@ HelpContextID="0" CompatibleMode="0" MajorVer=1 MinorVer=0 -RevisionVer=18 +RevisionVer=19 AutoIncrementVer=1 ServerSupportFiles=0 CompilationType=0 diff --git a/README.md b/README.md index aa0cb3a..7505ba7 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,17 @@ -# -## +# Math_AngleWGS84UTM32 +## Classes Angle, GeoPos & UTM32 -[![GitHub](https://img.shields.io/github/license/OlimilO1402/?style=plastic)](https://github.com/OlimilO1402//blob/master/LICENSE) -[![GitHub release (latest by date)](https://img.shields.io/github/v/release/OlimilO1402/?style=plastic)](https://github.com/OlimilO1402//releases/latest) -[![Github All Releases](https://img.shields.io/github/downloads/OlimilO1402//total.svg)](https://github.com/OlimilO1402//releases/download/v2.3.4/.zip) -[![Follow](https://img.shields.io/github/followers/OlimilO1402.svg?style=social&label=Follow&maxAge=2592000)](https://github.com/OlimilO1402//watchers) +[![GitHub](https://img.shields.io/github/license/OlimilO1402/Math_AngleWGS84UTM32?style=plastic)](https://github.com/OlimilO1402/Math_AngleWGS84UTM32/blob/master/LICENSE) +[![GitHub release (latest by date)](https://img.shields.io/github/v/release/OlimilO1402/Math_AngleWGS84UTM32?style=plastic)](https://github.com/OlimilO1402/Math_AngleWGS84UTM32/releases/latest) +[![Github All Releases](https://img.shields.io/github/downloads/OlimilO1402/Math_AngleWGS84UTM32/total.svg)](https://github.com/OlimilO1402/Math_AngleWGS84UTM32/releases/download/v2.3.4/AngleWGS84UTM32.zip) +[![Follow](https://img.shields.io/github/followers/OlimilO1402.svg?style=social&label=Follow&maxAge=2592000)](https://github.com/OlimilO1402/Math_AngleWGS84UTM32/watchers) -Project started around mmm.yyyy. - - - -```vba -Property Get Value() -End Property -``` - -[Link text Here](https://link-url-here.org) - -![ Image](Resources/.png " Image") +Project started in march 2022. +The Angle class parses an angle for different purposes e.g. in grad-minute-second view. Angle has all trigonometric functions. +The GeoPos class is for gps geo-positioning-system purposes and uses the angle class for latitude and longitude. +For showing the correct functionality the small test app sends a kml file to google earth or a link to Koordinaten-umrechner.de +The GeoPos class calculates the distance between two of more geo-positions by using the Haversine-formula. +For compatibility for authoritative purposes the UTM-class creates UTM32-coordinates from WGS84 coordinates and vice versa. +You also have the possibility to view a track in google earth and show it's length calculated in google-earth. + +![AngleWGS84UTM32 Image](Resources/AngleWGS84UTM32.png "AngleWGS84UTM32 Image")