proj.line3d: Projections of Objects

View source: R/proj.R

proj.line3dR Documentation

Projections of Objects

Description

Computes 3D Projections

Usage

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, ...)

Arguments

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.

Details

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.

Value

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.

Examples

p = c(1,2,3)
line = matrix(c(0,5,2,3,1,4), nrow = 2)
proj.line3d(p, line)


Rpdb documentation built on March 16, 2026, 5:07 p.m.