Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TSG QC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
US191
TSG QC
Commits
dac4a8ec
Commit
dac4a8ec
authored
17 years ago
by
Yves Gouriou
Browse files
Options
Downloads
Patches
Plain Diff
Ajout du fichier dd2dm.m
parent
3d45e06f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tsg_util/dd2dm.m
+51
-0
51 additions, 0 deletions
tsg_util/dd2dm.m
with
51 additions
and
0 deletions
tsg_util/dd2dm.m
0 → 100644
+
51
−
0
View file @
dac4a8ec
function
string
=
dd2dm
(
posit
,
latlon
)
% STRING = DD2DM( posit, latlon )
% Convertit une position decimale en chaine de caractere
%
% string chaine de caracteres
% posit en degres decimaux
% latlon 0 pour la latitude - 1 pour la longitude
%
% $Id: dd2dm.m 297 2007-07-17 13:56:00Z jgrelet $
% representation ASCII du caractere degre
% pour assurer la comptatibilite windows/linux (ISO8859/UTF8)
degre
=
176
;
% Determine si latitude ou longitude
% ----------------------------------
if
latlon
==
1
neg
=
'W'
;
pos
=
'E'
;
else
neg
=
'S'
;
pos
=
'N'
;
end
% Cree les labels
% ---------------
if
posit
<
0
geo
=
neg
;
else
geo
=
pos
;
end
% Conversion et formattage
% on n'affiche pas les decimales pour les minutes
% car la precision n'est pas suffisante (currentpoint)
% ---------------------------------------------
% posit
h
=
fix
(
posit
);
m
=
(
posit
-
h
)
*
60
;
if
abs
(
m
)
>
59
if
posit
>
0
h
=
h
+
1
;
else
h
=
h
-
1
;
end
m
=
0
;
end
string
=
sprintf
(
'%02d%c%06.3f %c'
,
abs
(
h
),
degre
,
abs
(
m
),
geo
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment