Learn R Programming

fmesher (version 0.3.0)

fm_bary_loc: 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 fm_mesh_2d fm_bary_loc(mesh, bary = NULL, ..., format = NULL)

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

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

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

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

Value

Output format depends on the mesh class.

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.

Methods (by class)

  • fm_bary_loc(fm_mesh_2d): Extract points on a triangle mesh. Implemented formats are "matrix" (default) and "sf".

  • fm_bary_loc(fm_mesh_3d): Extract points on a tetrahedron mesh. Implemented format is "matrix" (default).

  • fm_bary_loc(fm_mesh_1d): Extract points on a 1D mesh. Implemented formats are "numeric" (default).

  • fm_bary_loc(fm_lattice_2d): Extract points on a 2D lattice. Implemented formats are "matrix" (default) and "sf".

  • fm_bary_loc(fm_lattice_Nd): Extract points on a ND lattice.

See Also

fm_bary(), fm_bary_simplex()

Examples

Run this code
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")
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)

Run the code above in your browser using DataLab