fm_bary_loc {fmesher}R Documentation

Extract Euclidean Sgeometry from Barycentric coordinates

Description

Extract the Euclidean coordinates for location identified by an fm_bary object. This acts as the inverse of fm_bary().

Usage

fm_bary_loc(mesh, bary = NULL, ..., format = NULL)

## S3 method for class 'fm_mesh_2d'
fm_bary_loc(mesh, bary = NULL, ..., format = NULL)

## S3 method for class 'fm_mesh_3d'
fm_bary_loc(mesh, bary = NULL, ..., format = NULL)

## S3 method for class 'fm_mesh_1d'
fm_bary_loc(mesh, bary = NULL, ..., format = NULL)

## S3 method for class 'fm_lattice_2d'
fm_bary_loc(mesh, bary = NULL, ..., format = NULL)

## S3 method for class 'fm_lattice_Nd'
fm_bary_loc(mesh, bary = NULL, ..., format = NULL)

Arguments

mesh

A mesh object, e.g. fm_mesh_2d or fm_mesh_1d.

bary

An fm_bary object. If NULL, return the mesh nodes is the mesh class supports it, otherwise gives an error.

...

Further arguments potentially used by sub-methods.

format

Optional format for the output. If NULL, the output format is determined by the default for the mesh object.

Value

Output format depends on the mesh class.

Methods (by class)

See Also

fm_bary(), fm_bary_simplex()

Examples

head(fm_bary_loc(fmexample$mesh))
bary <- fm_bary(fmexample$mesh, fmexample$loc_sf)
fm_bary_loc(fmexample$mesh, bary, format = "matrix")
fm_bary_loc(fmexample$mesh, bary, format = "sf")
(m <- fm_mesh_3d(
  matrix(c(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0), 4, 3, byrow = TRUE),
  matrix(c(1, 2, 3, 4), 1, 4, byrow = TRUE)
))
(bary <- fm_bary(m, rbind(
  cbind(0.1, 0.2, 0.3),
  cbind(-0.1, 0.2, 0.3)
)))
fm_bary_loc(m, bary)
mesh1 <- fm_mesh_1d(1:4)
fm_bary_loc(mesh1)
(bary1 <- fm_bary(mesh1, seq(0, 5, by = 0.5)))
fm_bary_loc(mesh1, bary1)
(bary1 <- fm_bary(mesh1, seq(0, 5, by = 0.5), restricted = TRUE))
fm_bary_loc(mesh1, bary1)
fm_basis(mesh1, bary1)
(bary1 <- fm_bary(mesh1, bary1, method = "nearest"))
fm_bary_loc(mesh1, bary1)
fm_basis(mesh1, bary1)
(bary1 <- fm_bary(mesh1, bary1, method = "linear"))
fm_bary_loc(mesh1, bary1)
fm_basis(mesh1, bary1)
m <- fm_lattice_2d(x = 1:3, y = 1:4)
head(fm_bary_loc(m))
(bary <- fm_bary(m, cbind(1.5, 3.2)))
fm_bary_loc(m, bary, format = "matrix")
fm_bary_loc(m, bary, format = "sf")
m <- fm_lattice_Nd(list(x = 1:3, y = 1:4, z = 1:2))
head(fm_bary_loc(m))
(bary <- fm_bary(m, cbind(1.5, 3.2, 1.5)))
fm_bary_loc(m, bary)

[Package fmesher version 0.5.0 Index]