| proj.line3d | R Documentation |
Computes 3D Projections
proj.line3d(p, x, y, z, ...)
## S3 method for class 'line3d.numeric'
proj(p, x, y = NULL, z = NULL, ...)
## S3 method for class 'line3d.matrix'
proj(p, x, y = NULL, z = NULL, ...)
p |
numeric array or matrix with the x,y,z coordinates of the point or collection of points. |
x, y, z |
an R object containing the coordinates of the end-points of the line segment; can be specified either as individual values or as a matrix. |
... |
currently not used. |
The purpose of the ‘proj’ helper functions is to compute the spatial projections of various objects on other geometrical structures. Currently, only projection of points on a line segment are implemented.
The methods for the ‘proj.line3d’ function compute the projections of 1 point or a collection of points on a line segment defined by the 2 delimiting points.
The ‘numeric’ method projects a point, while the ‘matrix’ method projects a collection of points on another geometric object.
The proj.line3d function returns an object
of class ‘proj’ containing the 3-dimensional coordinates of
the projected point, as well as a scalar value representing the fraction
of the path on the line segment.
p = c(1,2,3)
line = matrix(c(0,5,2,3,1,4), nrow = 2)
proj.line3d(p, line)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.