getTArea: Compute triangle area from 3D coordinates

View source: R/surf_Area.R

getTAreaR Documentation

Compute triangle area from 3D coordinates

Description

Computes the area of a triangle from 3D coordinates

Usage

getTArea(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 area (0 for degenerate triangles) or NA in case of bad input

Note

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

Examples

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

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