volume_hexahedron: Hexahedron volume

View source: R/volumes.R

volume_hexahedronR Documentation

Hexahedron volume

Description

Volume of a hexahedron.

Usage

volume_hexahedron(hexahedron)

Arguments

hexahedron

a 3 times 8 matrix whose columns are the eight vertices of the hexahedron; see makeHexahedron

Value

The volume of the hexahedron.

Examples

library(uniformly)
# a cube with side 2 ####
hexahedron <- makeHexahedron(
  p0 = c(0, 0, 0),
  p1 = c(2, 0, 0),
  p2 = c(2, 2, 0),
  p3 = c(0, 2, 0),
  p4 = c(0, 2, 2),
  p5 = c(0, 0, 2),
  p6 = c(2, 0, 2),
  p7 = c(2, 2, 2)
)
volume_hexahedron(hexahedron) # should be 8

stla/uniformly documentation built on July 29, 2023, 4:35 p.m.