paraplane {pcds} | R Documentation |
The plane at a point and parallel to the plane spanned
by three distinct 3D points a
, b
, and c
Description
An object of class "Planes"
.
Returns the equation and -coordinates of the plane
passing through point
p
and parallel to the plane spanned
by three distinct 3D points a
, b
,
and c
with - and
-coordinates are provided
in vectors
x
and y
,
respectively.
Usage
paraplane(p, a, b, c, x, y)
Arguments
p |
A 3D point which the plane parallel to the plane spanned by
three distinct 3D points |
a , b , c |
3D points that determine the plane to which the plane
crossing point |
x , y |
Scalars or |
Value
A list
with the elements
desc |
Description of the plane passing through point |
points |
The input points |
x , y |
The input vectors which constitutes the |
z |
The output |
coeff |
Coefficients of the plane (in the |
equation |
Equation of the plane in long form |
equation2 |
Equation of the plane in short form, to be inserted on the plot |
Author(s)
Elvan Ceyhan
See Also
Examples
Q<-c(1,10,3); R<-c(1,1,3); S<-c(3,9,12); P<-c(1,1,0)
pts<-rbind(Q,R,S,P)
paraplane(P,Q,R,S,.1,.2)
xr<-range(pts[,1]); yr<-range(pts[,2])
xf<-(xr[2]-xr[1])*.25
#how far to go at the lower and upper ends in the x-coordinate
yf<-(yr[2]-yr[1])*.25
#how far to go at the lower and upper ends in the y-coordinate
x<-seq(xr[1]-xf,xr[2]+xf,l=5) #try also l=10, 20, or 100
y<-seq(yr[1]-yf,yr[2]+yf,l=5) #try also l=10, 20, or 100
plP2QRS<-paraplane(P,Q,R,S,x,y)
plP2QRS
summary(plP2QRS)
plot(plP2QRS,theta = 225, phi = 30, expand = 0.7, facets = FALSE, scale = TRUE)
paraplane(P,Q,R,Q+R,.1,.2)
z.grid<-plP2QRS$z
plQRS<-Plane(Q,R,S,x,y)
plQRS
pl.grid<-plQRS$z
zr<-max(z.grid)-min(z.grid)
Pts<-rbind(Q,R,S,P)+rbind(c(0,0,zr*.1),c(0,0,zr*.1),
c(0,0,zr*.1),c(0,0,zr*.1))
Mn.pts<-apply(Pts[1:3,],2,mean)
plot3D::persp3D(z = pl.grid, x = x, y = y, theta =225, phi = 30,
ticktype = "detailed",
main="Plane Crossing Points Q, R, S\n and Plane Passing P Parallel to it")
#plane spanned by points Q, R, S
plot3D::persp3D(z = z.grid, x = x, y = y,add=TRUE)
#plane parallel to the original plane and passing thru point \code{P}
plot3D::persp3D(z = z.grid, x = x, y = y, theta =225, phi = 30,
ticktype = "detailed",
main="Plane Crossing Point P \n and Parallel to the Plane Crossing Q, R, S")
#plane spanned by points Q, R, S
#add the defining points
plot3D::points3D(Pts[,1],Pts[,2],Pts[,3], add=TRUE)
plot3D::text3D(Pts[,1],Pts[,2],Pts[,3], c("Q","R","S","P"),add=TRUE)
plot3D::text3D(Mn.pts[1],Mn.pts[2],Mn.pts[3],plP2QRS$equation,add=TRUE)
plot3D::polygon3D(Pts[1:3,1],Pts[1:3,2],Pts[1:3,3], add=TRUE)