View source: R/geom_findCenter.R
circleCenter | R Documentation |
Computes the coordinates of the center point of a circle defined, in 3D space, by 3 points on the circumference.
circleCenter(p)
p |
A 3x3 matrix-like object containing 3D coordinates of points defining the circumference (one xyz coordinate per row) |
A data.frame containing the x,y,z coordinates of the circle center. An error will be returned if the input points are collinear or duplicated.
Cornel M. Pop
p <- data.frame(x=c(1, 4, 5), y=c(0, 5, 1), z=c(1.4, -4, 4))
res <- circleCenter(p)
# distance from computer center to input point 1
dist(rbind(res, p[1,]), method="euclidean")
# distance from computer center to input point 2
dist(rbind(res, p[2,]), method="euclidean")
# distance from computer center to input point 3
dist(rbind(res, p[3,]), method="euclidean")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.