Apply a spatial transformation matrix to the given coordinates.
Source:R/mghheader.R
doapply.transform.mtx.RdApply a spatial transformation matrix to the given coordinates.
Arguments
- coords
nx3 (cartesian) or nx4 (homogeneous) numerical matrix, the input coordinates. If nx4, left as is for homogeneous notation, if nx3 (cartesian) a 1 will be appended as the 4th position.
- mtx
a 4x4 numerical transformation matrix
- as_mat
logical, whether to force the output coords into a matrix (even if the input was a vector/a single coordinate triple).