Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Daniel Bourgault
g_rect
Commits
e70023e3
Commit
e70023e3
authored
Mar 22, 2019
by
Elie Dumas-Lefebvre
Committed by
Elie Dumas-Lefebvre
Mar 22, 2019
Browse files
Version matricielle de la resolution (combinaison de g_res et de g_dist en un)
parent
5934cd22
Changes
1
Show whitespace changes
Inline
Side-by-side
src/g_rect/g_res_field.m
0 → 100644
View file @
e70023e3
function
delta
=
g_res_field
(
LAT
,
LON
)
% LAT and LON difference in the x-axis
dLATi
=
diff
(
LAT
,
1
,
2
);
dLONi
=
diff
(
LON
,
1
,
2
);
% LAT and LON difference in the y-axis
dLATj
=
diff
(
LAT
,
1
,
1
);
dLONj
=
diff
(
LON
,
1
,
1
);
% Mean LAT in both x and y axis
LAT_meani
=
0.5
*
(
LAT
(:,
2
:
end
)
+
LAT
(:,
1
:
end
-
1
));
LAT_meanj
=
0.5
*
(
LAT
(
2
:
end
,
:)
+
LAT
(
1
:
end
-
1
,
:));
% Conversion from degree to meters
meterPerDegLat
=
1852
*
60.0
;
meterPerDegLoni
=
meterPerDegLat
.*
cosd
(
LAT_meani
);
meterPerDegLonj
=
meterPerDegLat
.*
cosd
(
LAT_meanj
);
dxi
=
dLONi
.*
meterPerDegLoni
;
dxj
=
dLONj
.*
meterPerDegLonj
;
dyi
=
dLATi
.*
meterPerDegLat
;
dyj
=
dLATj
.*
meterPerDegLat
;
% Distances in x and y axis
deltai
=
sqrt
(
dxi
.^
2
+
dyi
.^
2
);
deltaj
=
sqrt
(
dxj
.^
2
+
dyj
.^
2
);
% Overall distance
delta
=
sqrt
(
deltai
.^
2
+
deltaj
.^
2
);
end
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment