Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institute of Technical Acoustics (ITA)
toolbox
Commits
88f2704e
Commit
88f2704e
authored
Dec 05, 2017
by
Jan-Gerrit Richter
Browse files
bugfix: if more than one point is found in findnearest, search sph domain (usually needed at poles)
parent
d7ae6197
Changes
1
Hide whitespace changes
Inline
Side-by-side
kernel/ClassStuff/@itaCoordinates/findnearest.m
View file @
88f2704e
...
...
@@ -34,6 +34,12 @@ else
dists
=
sqrt
(
sum
((
this
.
cart
-
repmat
(
coords
.
cart
(
idinput
,:),
size
(
this
.
cart
,
1
),
1
))
.^
2
,
2
));
for
idx
=
1
:
num
[
dist
(
idinput
,
idx
),
ind
(
idinput
,
idx
)]
=
min
(
dists
);
%#ok<AGROW>
if
sum
(
dists
==
min
(
dists
))
>
1
distsSph
=
sqrt
(
sum
((
this
.
sph
-
repmat
(
coords
.
sph
(
idinput
,:),
size
(
this
.
sph
,
1
),
1
))
.^
2
,
2
));
[
dist
(
idinput
,
idx
),
ind
(
idinput
,
idx
)]
=
min
(
distsSph
);
end
dists
(
ind
(
idinput
,
idx
))
=
inf
;
end
end
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment