meshmetrics: Calculate a number of different geometric attributes of a...

View source: R/meshmetrics.r

meshmetricsR Documentation

Calculate a number of different geometric attributes of a Delaunay triangulation

Description

Calculates a number of geometric attributes for a given Delaunay triangulation based on the circumscribed and inscribed circle of each triangle.

Usage

meshmetrics(mesh)

Arguments

mesh

A fmesher::fm_mesh_2d object.

Details

A triangle's circumcircle (circumscribed circle) is the unique circle that passes through each of its three vertices. A triangle's incircle (inscribed circle) is the largest circle that can be contained within it (i.e., touches it's three edges).

Value

An object of class sf with the following data for each triangle in the triangulation

  • V1, V2, and V3 corresponding vertices of mesh matches mesh$graph$tv;

  • ID, numeric triangle id;

  • angleA, angleB, and angleC, the interior angles;

  • circumcircle radius, circumradius, circumcircle_R (R);

  • incircle radius incircle_r (r);

  • centroid locations of the circumcircle, circumcenter, (c_Ox, c_Oy);

  • centroid locations of the incircle, incenter, (i_Ox, i_Oy);

  • the radius-edge ratio radius_edge \frac{R}{l_{min}}, where l_{min} is the minimum edge length;

  • the radius ratio radius_ratio \frac{r}{R};

  • area, area (A);

  • quality a measure of "quality" defined as \frac{4\sqrt{3}|A|}{\Sigma_{i = 1}^3 L_i^2}, where L_i is the length of edge i.

Examples

data(horse_mesh, package = "stelfi")
metrics <- meshmetrics(horse_mesh)
if(require("ggplot2")) {
ggplot(metrics) + geom_sf(aes(fill = radius_ratio))
}

cmjt/stelfi documentation built on Oct. 25, 2023, 2:53 p.m.