Skip to content

Commit

Permalink
1.0.6: Proj string output
Browse files Browse the repository at this point in the history
  • Loading branch information
zvezdochiot committed Jun 26, 2022
1 parent d394723 commit c2a61a2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/helmeltrans.c
Expand Up @@ -85,7 +85,7 @@ int main(int argc, char* argv[])
exit(EXIT_FAILURE);
}
command = argv[1];
if (!strcmp(command,"xyz"))
if (!strcmp(command,"xyz"))
{
fprintf(stdout,"B-L-H -> X-Y-Z...\n");
}
Expand Down Expand Up @@ -124,7 +124,7 @@ int main(int argc, char* argv[])
}
else
ofile = stdout;

if(ofile == NULL)
{
fprintf(stderr,"Error writing %s\n",ofilename);
Expand All @@ -144,7 +144,7 @@ int main(int argc, char* argv[])
b2 = b * b;
ro = M_PI / 180.0;
roi = 180.0 / M_PI;
if (!strcmp(command,"xyz"))
if (!strcmp(command,"xyz"))
{
while(fgets( ibuf, 256, ifile)!=NULL)
{
Expand Down
3 changes: 2 additions & 1 deletion src/helmert3d.h
Expand Up @@ -22,9 +22,10 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define VERS "1.0.5"
#define VERS "1.0.6"
#define C_AUTHOR "U. Niethammer"
#define C_YEAR "2021"
#define DEBUG 0
#define RAD2ARC 206264.8062

#endif // HELMERT3D_H
9 changes: 8 additions & 1 deletion src/helmparms3d.c
Expand Up @@ -288,6 +288,7 @@ int main(int argc, char* argv[])
double **R_mat=NULL;
double trace1=0.0, trace2=0.0;
double scal=0.0, ppm=0.0;
double rx=0.0, ry=0.0, rz=0.0;
FILE *outfile;

fprintf(stdout,"\n*******************************\n");
Expand Down Expand Up @@ -514,7 +515,7 @@ int main(int argc, char* argv[])
fprintf(stderr,"Error writing %s\n",out_param_name);
exit(EXIT_FAILURE);
}

matrix_init(n, m, src_mat_T);
matrix_transpose(n, n, R_mat, src_mat_T);
fprintf(stdout,"R =\n");
Expand All @@ -529,6 +530,12 @@ int main(int argc, char* argv[])

fprintf(stdout,"s = %10.10lf (= %10.10lf ppm)\n\n",scal, ppm);

rx = 0.5 * (src_mat_T[2][1] - src_mat_T[1][2]) * RAD2ARC;
ry = 0.5 * (src_mat_T[0][2] - src_mat_T[2][0]) * RAD2ARC;
rz = 0.5 * (src_mat_T[1][0] - src_mat_T[0][1]) * RAD2ARC;
fprintf(stdout,"Proj string:\n");
fprintf(stdout,"+towgs84=%.3f,%.3f,%.3f,%.3f,%.3f,%.3f,%.3f\n\n", T_vec[0], T_vec[1], T_vec[2], rx, ry, rz, ppm);

if(argc < 4)
{
fprintf(stdout,"Results matrix:\n");
Expand Down

1 comment on commit c2a61a2

@zvezdochiot
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.