Recent

Author Topic: Vincenty's geodesy formulae  (Read 942 times)

VTwin

  • Hero Member
  • *****
  • Posts: 775
  • Former Turbo Pascal 3 user
Re: Vincenty's geodesy formulae
« Reply #15 on: September 16, 2019, 01:58:31 am »
Minor fix to better deal with commas.
« Last Edit: September 16, 2019, 02:02:14 am by VTwin »
“Talk is cheap. Show me the code.” -Linus Torvalds

macOS 10.13.6: Lazarus 2.0 fixes svn 61930 (64 bit Cocoa)
Ubuntu 18.04.3: Lazarus 2.0.4 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.0.4 (64 bit on VBox)
fpc 3.0.4

VTwin

  • Hero Member
  • *****
  • Posts: 775
  • Former Turbo Pascal 3 user
Re: Vincenty's geodesy formulae
« Reply #16 on: September 16, 2019, 03:46:13 am »
Thanks, yes that is simpler.

Code: Pascal  [Select]
  1.  
  2. const
  3.   cLegals : set of char = ['+', '-', '.', ',', '0'..'9'];
  4.  
  5. function IsLegal(c: string): boolean;
  6. begin
  7.   result := (Length(c) = 1) and (c[1] in cLegals);
  8. end;
  9.  

I tried something similar and it did not compile.
“Talk is cheap. Show me the code.” -Linus Torvalds

macOS 10.13.6: Lazarus 2.0 fixes svn 61930 (64 bit Cocoa)
Ubuntu 18.04.3: Lazarus 2.0.4 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.0.4 (64 bit on VBox)
fpc 3.0.4

serbod

  • Full Member
  • ***
  • Posts: 127
Re: Vincenty's geodesy formulae
« Reply #17 on: September 16, 2019, 08:47:32 am »

Thaddy

  • Hero Member
  • *****
  • Posts: 8973
Re: Vincenty's geodesy formulae
« Reply #18 on: September 16, 2019, 09:16:19 am »
It is useful, but can use some clear optimizations. (just speed, and factoring out the lcl dependencies)
« Last Edit: September 16, 2019, 09:18:41 am by Thaddy »
Most people that want to use threading should learn to patch their jeans first: use a needle.

VTwin

  • Hero Member
  • *****
  • Posts: 775
  • Former Turbo Pascal 3 user
Re: Vincenty's geodesy formulae
« Reply #19 on: September 16, 2019, 05:55:43 pm »
https://github.com/serbod/osmap/blob/master/osmapgeometry.pas

I hope, it can be useful.

Very nice, thanks! It may have some useful functions for me. It looks like the Vincenty code is from the same source as mine, identical variable names, etc.
« Last Edit: September 16, 2019, 06:14:01 pm by VTwin »
“Talk is cheap. Show me the code.” -Linus Torvalds

macOS 10.13.6: Lazarus 2.0 fixes svn 61930 (64 bit Cocoa)
Ubuntu 18.04.3: Lazarus 2.0.4 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.0.4 (64 bit on VBox)
fpc 3.0.4