planeCoefs: Get plane equation coefficients from 3 points:

View source: R/geom_p2pIntersect.R

planeCoefsR Documentation

Get plane equation coefficients from 3 points:

Description

Computes the coefficients of the plane equation for a plane defined by 3 3D points.

Usage

planeCoefs(p)

Arguments

p

A 3x3 matrix-like object of point coordinates, one point per row.

Value

A vector of scalar plane equation coefficients in the form Ax + By + Cz + D = 0

TODO

Write unit tests

Author(s)

Cornel M. Pop

Examples

p = data.frame(x=c(1,4,5), y=c(0,5,1), z=c(1.4, -4, 4))
res = planeCoefs(p)
## Not run: 
library(rgl)
points3d(p, size=10, col="red")
planes3d(res[1], res[2], res[3], res[4], col="green")

## End(Not run)

cornelmpop/Lithics3D documentation built on Feb. 10, 2024, 11:54 p.m.