Skip to content

Commit 0fa0357

Browse files
committed
2.5: dZ of radius Earth
1 parent 7eb3a48 commit 0fa0357

File tree

11 files changed

+83
-34
lines changed

11 files changed

+83
-34
lines changed

doc/AUTHORS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Name: GeoFindKey
22
OldName: FindKey
33
URL: https://github.com/Geo-Linux-Calculations/geofindkey
4-
Date: 2020-09-24
4+
Date: 2021-10-10
55
Authors:
66
Игорь Белов (https://gis-lab.info/forum/memberlist.php?mode=viewprofile&u=10457)
77
zvezdochiot (https://github.com/zvezdochiot)

doc/CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ Name: GeoFindKey
22
OldName: FindKey
33
URL: https://github.com/Geo-Linux-Calculations/geofindkey
44

5+
2.5
6+
7+
dZ of radius Earth
8+
59
2.4
610

711
invert scale

doc/LICENSE

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Public Domain Mark 1.0
2+
No Copyright
3+
4+
This work has been identified as being free of known restrictions
5+
under copyright law, including all related and neighboring rights.
6+
7+
You can copy, modify, distribute and perform the work, even for
8+
commercial purposes, all without asking permission. See Other
9+
Information below.
10+
11+
Other Information
12+
13+
The work may not be free of known copyright restrictions in all
14+
jurisdictions.
15+
16+
Persons may have other rights in or related to the work, such as
17+
patent or trademark rights, and others may have rights in how the
18+
work is used, such as publicity or privacy rights.
19+
20+
In some jurisdictions moral rights of the author may persist beyond
21+
the term of copyright. These rights may include the right to be
22+
identified as the author and the right to object to derogatory
23+
treatments.
24+
25+
Unless expressly stated otherwise, the person who identified the work
26+
makes no warranties about the work, and disclaims liability for all
27+
uses of the work, to the fullest extent permitted by applicable law.
28+
29+
When using or citing the work, you should not imply endorsement by
30+
the author or the person who identified the work.

man/man1/geofindkey.1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "GeoFindKey" 1 2.2 "11 Sep 2020" "User Manual"
1+
.TH "GeoFindKey" 1 2.5 "10 Oct 2021" "User Manual"
22

33
.SH NAME
44
geofindkey
@@ -66,7 +66,7 @@ report-file
6666
geofindkey doc/data.dat report.dat
6767

6868
.SH COPYRIGHT
69-
Copyright 2018-2020 zvezdochiot.
69+
Copyright 2018-2021 zvezdochiot.
7070
All rights reserved.
7171

7272
.SH SEE ALSO

man/man1/geofindkey2p.1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "GeoFindKey2Pow" 1 2.2 "11 Sep 2020" "User Manual"
1+
.TH "GeoFindKey2Pow" 1 2.5 "10 Oct 2021" "User Manual"
22

33
.SH NAME
44
geofindkey2p
@@ -66,7 +66,7 @@ report-file
6666
geofindkey2p doc/data.dat report.dat
6767

6868
.SH COPYRIGHT
69-
Copyright 2018-2020 zvezdochiot.
69+
Copyright 2018-2021 zvezdochiot.
7070
All rights reserved.
7171

7272
.SH SEE ALSO

man/man1/geositer500.1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "GeoSIter500" 1 2.2 "11 Sep 2020" "User Manual"
1+
.TH "GeoSIter500" 1 2.5 "10 Oct 2021" "User Manual"
22

33
.SH NAME
44
geositer500
@@ -14,6 +14,9 @@ geositer500 [option] input-file report-file
1414
-d N
1515
number of decimals in the result coordinates, default=4
1616
.TP
17+
-r N.N
18+
radius Earth, default=6370009.0
19+
.TP
1720
-u str
1821
units angles {RAD,DEG,GON,DMS}, default=DEG
1922
.TP
@@ -60,7 +63,7 @@ report-file
6063
geositer500 doc/szbunknow.dat szb.dat
6164

6265
.SH COPYRIGHT
63-
Copyright 2018-2020 zvezdochiot.
66+
Copyright 2018-2021 zvezdochiot.
6467
All rights reserved.
6568

6669
.SH SEE ALSO

man/man1/geoszbtoyxh.1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "GeoSZBtoYXH" 1 2.2 "11 Sep 2020" "User Manual"
1+
.TH "GeoSZBtoYXH" 1 2.5 "10 Oct 2021" "User Manual"
22

33
.SH NAME
44
geoszbtoyxh
@@ -14,6 +14,9 @@ geoszbtoyxh [options] [input-file [report-file]]
1414
-d N
1515
number of decimals in the result coordinates, default 4
1616
.TP
17+
-r N.N
18+
radius Earth, default=6370009.0
19+
.TP
1720
-u str
1821
units angles {RAD,DEG,GON,DMS}, default=DEG
1922
.TP
@@ -60,7 +63,7 @@ report-file optional, default stdout
6063
geoszbtoyxh doc/szb.dat yxh.dat
6164

6265
.SH COPYRIGHT
63-
Copyright 2018-2020 zvezdochiot.
66+
Copyright 2018-2021 zvezdochiot.
6467
All rights reserved.
6568

6669
.SH SEE ALSO

src/geofindkey.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*
22
Name: geofindkey.c
33
OldName: findkey.c
4-
Version: 2.4
5-
Date: 2020-09-28
4+
Version: 2.5
5+
Date: 2021-10-10
66
Author: Игорь Белов (https://gis-lab.info/forum/memberlist.php?mode=viewprofile&u=10457)
77
Author: zvezdochiot (https://github.com/zvezdochiot)
88
Author: Zoltan Siki (https://github.com/zsiki)
@@ -52,7 +52,7 @@ key(normal):
5252
#include <unistd.h>
5353

5454
#define PNAME "GeoFindKey"
55-
#define PVERSION "2.4"
55+
#define PVERSION "2.5"
5656

5757
void geofindkeytitle()
5858
{

src/geofindkey2p.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
Name: geofindkey2p.c
3-
Version: 2.4
4-
Date: 2020-09-28
3+
Version: 2.5
4+
Date: 2021-10-10
55
Author: zvezdochiot (https://github.com/zvezdochiot)
66
*
77
build:
@@ -57,7 +57,7 @@ output file report.dat:
5757
#include <unistd.h>
5858

5959
#define PNAME "GeoFindKey2Pow"
60-
#define PVERSION "2.4"
60+
#define PVERSION "2.5"
6161

6262
void geofindkey2ptitle()
6363
{

src/geositer500.c

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
Name: geositer500.c
3-
Version: 2.4
4-
Date: 2020-09-28
3+
Version: 2.5
4+
Date: 2021-10-10
55
Author: zvezdochiot (https://github.com/zvezdochiot)
66
Author: Zoltan Siki (https://github.com/zsiki)
77
*
@@ -54,7 +54,7 @@ OKD-12 3.8890 288.39138889 133.60805556
5454
#include <string.h>
5555

5656
#define PNAME "GeoSIter500"
57-
#define PVERSION "2.4"
57+
#define PVERSION "2.5"
5858

5959
#define defUnits "DEG"
6060

@@ -68,6 +68,7 @@ void geositer500usage()
6868
fprintf(stderr, "usage: geositer500 [option] input-file report-file\n");
6969
fprintf(stderr, "options:\n");
7070
fprintf(stderr, " -d N decimal after comma, default=4\n");
71+
fprintf(stderr, " -r N.N radius Earth, default=6370009.0\n");
7172
fprintf(stderr, " -u str units angles {RAD,DEG,GON,DMS}, default=DEG\n");
7273
fprintf(stderr, " -h this help\n");
7374
fprintf(stderr, "\n");
@@ -149,12 +150,13 @@ int main(int argc, char *argv[])
149150
int np;
150151
FILE *fp0, *fp1;
151152

153+
double RE = 6370009.0;
154+
152155
int opt;
153-
double PI2 = M_PI / 2.0; /* PI/2 */
154156
int decimals = 4; /* number of decimals in the calculated coordinates */
155157
int fhelp = 0;
156158
units = defUnits;
157-
while ((opt = getopt(argc, argv, "d:u:h")) != -1)
159+
while ((opt = getopt(argc, argv, "d:r:u:h")) != -1)
158160
{
159161
switch(opt)
160162
{
@@ -164,6 +166,9 @@ int main(int argc, char *argv[])
164166
case 'd':
165167
decimals = atoi(optarg);
166168
break;
169+
case 'r':
170+
RE = atof(optarg);
171+
break;
167172
case 'u':
168173
units = optarg;
169174
break;
@@ -242,10 +247,10 @@ int main(int argc, char *argv[])
242247
j++;
243248
}
244249
x[1] = ANGLEtoRAD(x[1], units);
245-
x[1] = PI2 - x[1];;
250+
x[1] -= (RE > 0.0) ? (x[0] * sin(x[1]) * 0.5 / RE) : 0.0;
246251
x[2] = ANGLEtoRAD(x[2], units);
247-
y[2] = x[0] * sin(x[1]);
248-
x[0] *= cos(x[1]);
252+
y[2] = x[0] * cos(x[1]);
253+
x[0] *= sin(x[1]);
249254
y[0] = x[0] * sin(x[2]);
250255
y[1] = x[0] * cos(x[2]);
251256
for (i = 0; i < 3; i++)
@@ -279,10 +284,10 @@ int main(int argc, char *argv[])
279284
j++;
280285
}
281286
x[1] = ANGLEtoRAD(x[1], units);
282-
x[1] = PI2 - x[1];;
287+
x[1] -= (RE > 0.0) ? (x[0] * sin(x[1]) * 0.5 / RE) : 0.0;
283288
x[2] = ANGLEtoRAD(x[2], units);
284-
y[2] = x[0] * sin(x[1]);
285-
x[0] *= cos(x[1]);
289+
y[2] = x[0] * cos(x[1]);
290+
x[0] *= sin(x[1]);
286291
y[0] = x[0] * sin(x[2]);
287292
y[1] = x[0] * cos(x[2]);
288293
for (i = 0; i < 3; i++)

0 commit comments

Comments
 (0)