-
Notifications
You must be signed in to change notification settings - Fork 37
Implemented ellipse-rectangle intersection test #3833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation does not fully work.
julia> R5 = Hyperrectangle(N[0.0, 0.0], N[1.0, 1.0]);
julia> El5 = Ellipsoid(N[2.0, -2.0], Diagonal(N[1.9, 1.9]));
julia> isdisjoint(R5, El5)
false
David Eberly, “Distance Between a Point and an Ellipse, an Ellipsoid, or a Hyperellipsoid”, | ||
Geometric Tools, 2015. https://www.geometrictools.com/Documentation/DistancePointEllipseEllipsoid.pdf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where exactly can I find the algorithm in that reference?
### Notes | ||
It works only for 2D axis-aligned rectangles and ellipsoids. | ||
|
||
### Reference | ||
David Eberly, “Distance Between a Point and an Ellipse, an Ellipsoid, or a Hyperellipsoid”, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Notes | |
It works only for 2D axis-aligned rectangles and ellipsoids. | |
### Reference | |
David Eberly, “Distance Between a Point and an Ellipse, an Ellipsoid, or a Hyperellipsoid”, | |
### Notes | |
It works only for 2D axis-aligned rectangles and ellipsoids. | |
### Reference | |
David Eberly, “Distance Between a Point and an Ellipse, an Ellipsoid, or a Hyperellipsoid”, |
@assert dim(H) == dim(E) == 2 "$H and $E must both have 2 dimensions." | ||
|
||
# center to the origin | ||
H_trans = translate(H, -H.center) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You do not need H_trans
. You can just use H
and modify the center of bbox
.
bbox = overapproximate(H_trans ⊕ E_trans, Hyperrectangle) | ||
if any(abs.(K) .> bbox.radius) | ||
return true | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this first part necessary? It sounds more expensive to compute than the rest of the method.
Added a specialized
isdisjoint
method for 2dHyperrectangle
andEllipsoid
intersection tests(issue2064)