Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
vadere
vadere
Commits
251c0b36
Commit
251c0b36
authored
Sep 29, 2020
by
Benedikt Zoennchen
Browse files
BugFix: Wrong virtual angle computation for obtuse triangles for eikonal solvers on the mesh.
parent
e41fd5ee
Pipeline
#329902
passed with stages
in 129 minutes and 36 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
VadereSimulator/src/org/vadere/simulator/models/potential/solver/calculators/mesh/MeshEikonalSolver.java
View file @
251c0b36
...
@@ -93,7 +93,7 @@ public interface MeshEikonalSolver<V extends IVertex, E extends IHalfEdge, F ext
...
@@ -93,7 +93,7 @@ public interface MeshEikonalSolver<V extends IVertex, E extends IHalfEdge, F ext
}
}
default
double
computeCosPhi
(
@NotNull
final
V
p1
,
@NotNull
final
V
p
,
@NotNull
final
V
p2
)
{
default
double
computeCosPhi
(
@NotNull
final
V
p1
,
@NotNull
final
V
p
,
@NotNull
final
V
p2
)
{
return
Math
.
cos
(
GeometryUtils
.
angle
3D
(
getMesh
().
getX
(
p1
),
getMesh
().
getY
(
p1
),
getMesh
().
getX
(
p
),
getMesh
().
getY
(
p
),
getMesh
().
getX
(
p2
),
getMesh
().
getY
(
p2
)));
return
Math
.
cos
(
GeometryUtils
.
angle
(
getMesh
().
getX
(
p1
),
getMesh
().
getY
(
p1
),
getMesh
().
getX
(
p
),
getMesh
().
getY
(
p
),
getMesh
().
getX
(
p2
),
getMesh
().
getY
(
p2
)));
}
}
/**
/**
...
...
VadereUtils/src/org/vadere/util/geometry/GeometryUtils.java
View file @
251c0b36
...
@@ -1390,8 +1390,11 @@ public class GeometryUtils {
...
@@ -1390,8 +1390,11 @@ public class GeometryUtils {
* @return the (smallest possible) angle3D at C from the triangle ACB.
* @return the (smallest possible) angle3D at C from the triangle ACB.
*/
*/
public
static
double
angle
(
@NotNull
final
IPoint
A
,
@NotNull
final
IPoint
C
,
@NotNull
final
IPoint
B
)
{
public
static
double
angle
(
@NotNull
final
IPoint
A
,
@NotNull
final
IPoint
C
,
@NotNull
final
IPoint
B
)
{
double
phi1
=
angleTo
(
A
,
C
);
return
angle
(
A
.
getX
(),
A
.
getY
(),
C
.
getX
(),
C
.
getY
(),
B
.
getX
(),
B
.
getY
());
double
phi2
=
angleTo
(
B
,
C
);
}
public
static
double
angle
(
final
double
xa
,
final
double
ya
,
final
double
xc
,
final
double
yc
,
final
double
xb
,
final
double
yb
)
{
double
phi1
=
angleTo
(
xa
,
ya
,
xc
,
yc
);
double
phi2
=
angleTo
(
xb
,
yb
,
xc
,
yc
);
double
phi
=
Math
.
abs
(
phi1
-
phi2
);
double
phi
=
Math
.
abs
(
phi1
-
phi2
);
return
Math
.
min
(
phi
,
2
*
Math
.
PI
-
phi
);
return
Math
.
min
(
phi
,
2
*
Math
.
PI
-
phi
);
}
}
...
...
Write
Preview
Markdown
is supported
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