ChrisToJ
2014-09-19
A “shiny” application to determine the best-fitting plane
for a set of five 3D points
In biology (e. g. 3D microscopy reconstruction) and
in geology (e. g. landmark measurements) and
in many other research
areas it is sometimes necessary to
determine a plain that best fits to a set of data points.
And often these data points are hard to obtain.
planeR can determine a plane from as few as five 3D point measurements.
The normal vector (blue line) of the best-fitting plane is determined by orthogonal distance regression.
The five 3D measurement points are shown in red, the centroid of the points is shown in green.
M <- matrix(c(2, 1, 0, 2, 0, 1, 1,.5,
.5, 1,0,.7, 1,.2,.5), 3)
# centroid of the points in matrix M
centroid <- apply(M, 1, mean)
centred <- sweep(M, 1, centroid, "-")
# normal vector of best-fitting plane
s <- svd(centred)
normal <- s$u[,match(min(s$d), s$d)]
centroid
[1] 1.40 0.34 0.54
normal
[1] -0.1326 0.6688 0.7316
planeR offers the following features:
Please share the link with everybody who might be interested!