Skip to content

Commit

Permalink
2.5: dZ of radius Earth
Browse files Browse the repository at this point in the history
  • Loading branch information
zvezdochiot committed Oct 12, 2021
1 parent 7eb3a48 commit 0fa0357
Show file tree
Hide file tree
Showing 11 changed files with 83 additions and 34 deletions.
2 changes: 1 addition & 1 deletion doc/AUTHORS
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Name: GeoFindKey
OldName: FindKey
URL: https://github.com/Geo-Linux-Calculations/geofindkey
Date: 2020-09-24
Date: 2021-10-10
Authors:
Игорь Белов (https://gis-lab.info/forum/memberlist.php?mode=viewprofile&u=10457)
zvezdochiot (https://github.com/zvezdochiot)
Expand Down
4 changes: 4 additions & 0 deletions doc/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ Name: GeoFindKey
OldName: FindKey
URL: https://github.com/Geo-Linux-Calculations/geofindkey

2.5

dZ of radius Earth

2.4

invert scale
Expand Down
30 changes: 30 additions & 0 deletions doc/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Public Domain Mark 1.0
No Copyright

This work has been identified as being free of known restrictions
under copyright law, including all related and neighboring rights.

You can copy, modify, distribute and perform the work, even for
commercial purposes, all without asking permission. See Other
Information below.

Other Information

The work may not be free of known copyright restrictions in all
jurisdictions.

Persons may have other rights in or related to the work, such as
patent or trademark rights, and others may have rights in how the
work is used, such as publicity or privacy rights.

In some jurisdictions moral rights of the author may persist beyond
the term of copyright. These rights may include the right to be
identified as the author and the right to object to derogatory
treatments.

Unless expressly stated otherwise, the person who identified the work
makes no warranties about the work, and disclaims liability for all
uses of the work, to the fullest extent permitted by applicable law.

When using or citing the work, you should not imply endorsement by
the author or the person who identified the work.
4 changes: 2 additions & 2 deletions man/man1/geofindkey.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "GeoFindKey" 1 2.2 "11 Sep 2020" "User Manual"
.TH "GeoFindKey" 1 2.5 "10 Oct 2021" "User Manual"

.SH NAME
geofindkey
Expand Down Expand Up @@ -66,7 +66,7 @@ report-file
geofindkey doc/data.dat report.dat

.SH COPYRIGHT
Copyright 2018-2020 zvezdochiot.
Copyright 2018-2021 zvezdochiot.
All rights reserved.

.SH SEE ALSO
Expand Down
4 changes: 2 additions & 2 deletions man/man1/geofindkey2p.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "GeoFindKey2Pow" 1 2.2 "11 Sep 2020" "User Manual"
.TH "GeoFindKey2Pow" 1 2.5 "10 Oct 2021" "User Manual"

.SH NAME
geofindkey2p
Expand Down Expand Up @@ -66,7 +66,7 @@ report-file
geofindkey2p doc/data.dat report.dat

.SH COPYRIGHT
Copyright 2018-2020 zvezdochiot.
Copyright 2018-2021 zvezdochiot.
All rights reserved.

.SH SEE ALSO
Expand Down
7 changes: 5 additions & 2 deletions man/man1/geositer500.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "GeoSIter500" 1 2.2 "11 Sep 2020" "User Manual"
.TH "GeoSIter500" 1 2.5 "10 Oct 2021" "User Manual"

.SH NAME
geositer500
Expand All @@ -14,6 +14,9 @@ geositer500 [option] input-file report-file
-d N
number of decimals in the result coordinates, default=4
.TP
-r N.N
radius Earth, default=6370009.0
.TP
-u str
units angles {RAD,DEG,GON,DMS}, default=DEG
.TP
Expand Down Expand Up @@ -60,7 +63,7 @@ report-file
geositer500 doc/szbunknow.dat szb.dat

.SH COPYRIGHT
Copyright 2018-2020 zvezdochiot.
Copyright 2018-2021 zvezdochiot.
All rights reserved.

.SH SEE ALSO
Expand Down
7 changes: 5 additions & 2 deletions man/man1/geoszbtoyxh.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "GeoSZBtoYXH" 1 2.2 "11 Sep 2020" "User Manual"
.TH "GeoSZBtoYXH" 1 2.5 "10 Oct 2021" "User Manual"

.SH NAME
geoszbtoyxh
Expand All @@ -14,6 +14,9 @@ geoszbtoyxh [options] [input-file [report-file]]
-d N
number of decimals in the result coordinates, default 4
.TP
-r N.N
radius Earth, default=6370009.0
.TP
-u str
units angles {RAD,DEG,GON,DMS}, default=DEG
.TP
Expand Down Expand Up @@ -60,7 +63,7 @@ report-file optional, default stdout
geoszbtoyxh doc/szb.dat yxh.dat

.SH COPYRIGHT
Copyright 2018-2020 zvezdochiot.
Copyright 2018-2021 zvezdochiot.
All rights reserved.

.SH SEE ALSO
Expand Down
6 changes: 3 additions & 3 deletions src/geofindkey.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
Name: geofindkey.c
OldName: findkey.c
Version: 2.4
Date: 2020-09-28
Version: 2.5
Date: 2021-10-10
Author: Игорь Белов (https://gis-lab.info/forum/memberlist.php?mode=viewprofile&u=10457)
Author: zvezdochiot (https://github.com/zvezdochiot)
Author: Zoltan Siki (https://github.com/zsiki)
Expand Down Expand Up @@ -52,7 +52,7 @@ key(normal):
#include <unistd.h>

#define PNAME "GeoFindKey"
#define PVERSION "2.4"
#define PVERSION "2.5"

void geofindkeytitle()
{
Expand Down
6 changes: 3 additions & 3 deletions src/geofindkey2p.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Name: geofindkey2p.c
Version: 2.4
Date: 2020-09-28
Version: 2.5
Date: 2021-10-10
Author: zvezdochiot (https://github.com/zvezdochiot)
*
build:
Expand Down Expand Up @@ -57,7 +57,7 @@ output file report.dat:
#include <unistd.h>

#define PNAME "GeoFindKey2Pow"
#define PVERSION "2.4"
#define PVERSION "2.5"

void geofindkey2ptitle()
{
Expand Down
27 changes: 16 additions & 11 deletions src/geositer500.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Name: geositer500.c
Version: 2.4
Date: 2020-09-28
Version: 2.5
Date: 2021-10-10
Author: zvezdochiot (https://github.com/zvezdochiot)
Author: Zoltan Siki (https://github.com/zsiki)
*
Expand Down Expand Up @@ -54,7 +54,7 @@ OKD-12 3.8890 288.39138889 133.60805556
#include <string.h>

#define PNAME "GeoSIter500"
#define PVERSION "2.4"
#define PVERSION "2.5"

#define defUnits "DEG"

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

double RE = 6370009.0;

int opt;
double PI2 = M_PI / 2.0; /* PI/2 */
int decimals = 4; /* number of decimals in the calculated coordinates */
int fhelp = 0;
units = defUnits;
while ((opt = getopt(argc, argv, "d:u:h")) != -1)
while ((opt = getopt(argc, argv, "d:r:u:h")) != -1)
{
switch(opt)
{
Expand All @@ -164,6 +166,9 @@ int main(int argc, char *argv[])
case 'd':
decimals = atoi(optarg);
break;
case 'r':
RE = atof(optarg);
break;
case 'u':
units = optarg;
break;
Expand Down Expand Up @@ -242,10 +247,10 @@ int main(int argc, char *argv[])
j++;
}
x[1] = ANGLEtoRAD(x[1], units);
x[1] = PI2 - x[1];;
x[1] -= (RE > 0.0) ? (x[0] * sin(x[1]) * 0.5 / RE) : 0.0;
x[2] = ANGLEtoRAD(x[2], units);
y[2] = x[0] * sin(x[1]);
x[0] *= cos(x[1]);
y[2] = x[0] * cos(x[1]);
x[0] *= sin(x[1]);
y[0] = x[0] * sin(x[2]);
y[1] = x[0] * cos(x[2]);
for (i = 0; i < 3; i++)
Expand Down Expand Up @@ -279,10 +284,10 @@ int main(int argc, char *argv[])
j++;
}
x[1] = ANGLEtoRAD(x[1], units);
x[1] = PI2 - x[1];;
x[1] -= (RE > 0.0) ? (x[0] * sin(x[1]) * 0.5 / RE) : 0.0;
x[2] = ANGLEtoRAD(x[2], units);
y[2] = x[0] * sin(x[1]);
x[0] *= cos(x[1]);
y[2] = x[0] * cos(x[1]);
x[0] *= sin(x[1]);
y[0] = x[0] * sin(x[2]);
y[1] = x[0] * cos(x[2]);
for (i = 0; i < 3; i++)
Expand Down
20 changes: 12 additions & 8 deletions src/geoszbtoyxh.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Name: geoszbtoyxh.c
Version: 2.4
Date: 2020-09-28
Version: 2.5
Date: 2021-10-10
Author: zvezdochiot (https://github.com/zvezdochiot)
Author: Zoltan Siki (https://github.com/zsiki)
*
Expand Down Expand Up @@ -55,7 +55,7 @@ OKD-12 -2.6721 2.5453 1.2270
#include <string.h>

#define PNAME "GeoSZBtoYXH"
#define PVERSION "2.4"
#define PVERSION "2.5"

#define defUnits "DEG"

Expand All @@ -69,6 +69,7 @@ void geoszbtoyxhusage()
fprintf(stderr, "usage: geoszbtoyxh [option] [input-file [report-file]]\n");
fprintf(stderr, "options:\n");
fprintf(stderr, " -d N decimal after comma, default=4\n");
fprintf(stderr, " -r N.N radius Earth, default=6370009.0\n");
fprintf(stderr, " -u str units angles {RAD,DEG,GON,DMS}, default=DEG\n");
fprintf(stderr, " -h this help\n");
fprintf(stderr, "\n");
Expand Down Expand Up @@ -149,10 +150,10 @@ int main(int argc, char *argv[])

int opt;
int decimals = 4; /* number of decimals in the calculated coordinates */
double PI2 = M_PI / 2.0; /* PI/2 */
double RE = 6370009.0;
int fhelp = 0; /* default no help*/
units = defUnits;
while ((opt = getopt(argc, argv, "d:u:h")) != -1)
while ((opt = getopt(argc, argv, "d:r:u:h")) != -1)
{
switch(opt)
{
Expand All @@ -162,6 +163,9 @@ int main(int argc, char *argv[])
case 'd':
decimals = atoi(optarg);
break;
case 'r':
RE = atof(optarg);
break;
case 'u':
units = optarg;
break;
Expand Down Expand Up @@ -215,10 +219,10 @@ int main(int argc, char *argv[])
name, &x[0], &x[1], &x[2], &z[0], &z[1], &z[2]);
if (np >= 4) {
x[1] = ANGLEtoRAD(x[1], units);
x[1] = PI2 - x[1];;
x[1] -= (RE > 0.0) ? (x[0] * sin(x[1]) * 0.5 / RE) : 0.0;
x[2] = ANGLEtoRAD(x[2], units);
y[2] = x[0] * sin(x[1]);
x[0] *= cos(x[1]);
y[2] = x[0] * cos(x[1]);
x[0] *= sin(x[1]);
y[0] = x[0] * sin(x[2]);
y[1] = x[0] * cos(x[2]);
if (np >= 7)
Expand Down

0 comments on commit 0fa0357

Please sign in to comment.