Sorting points in interval
Show older comments
I have matrix with xyz coordinate.(~20 points)
Else, i have matrix with the coordinates of the points that are the vertices of a plane.
How to choose the points inside of this plane ?
inpolygon function work only at 2D , but i have 3D plane.
1 Comment
dpb
on 5 Dec 2014
Do axis rotation to place plane in 2D???
Answers (1)
Image Analyst
on 5 Dec 2014
Edited: Image Analyst
on 5 Dec 2014
Chances are if they're floating point values they won't lie exactly on the plane to the nearest 15 decimal places, so you'll have to check if it's within some tolerance distance of the plane. Can't you just stick the (x,y,z) coordinate values into the equation of your plane and see if the residual is within your tolerance, like
residualDistance = a * x + b * y + c * z + d; % will = 0 if exactly on the plane.
if abs(residualDistance) <= yourToleranceValue
% It's "on" the plane
else
% It's far away from your plane.
end
If my math is wrong, someone please correct it.
Categories
Find more on Shifting and Sorting Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!