getTVol: Compute tetrahedron volume from triangle

View source: R/mesh_volume.R

getTVolR Documentation

Compute tetrahedron volume from triangle

Description

Computes the signed volume of a tetrahedron defined by the 3D coordinates of a triangle (i.e. triangle vertices + origin as vertex)

Usage

getTVol(coords)

Arguments

coords

a vector of concatenated xyz coordinates. Note that only the first 9 values will be used.

Value

numeric value of the computed volume or NA in case of bad input

Note

this function is currently too slow - 100k calls are processed in ~5.2 seconds.

Examples

# input format: c(x,y,z,x1,y1,z1,x2,y2,z2)
triangle <- c(-2,0,5,-10,-2,-1,1,0,0)
Lithics3D:::getTVol(triangle)

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