Learn R Programming

grip (version 0.3.0)

sierpinski_triangle_surface_helpers: Weighted Sierpinski triangle surface helpers

Description

Convenience helpers that take the canonical recursive embedding of the Sierpinski triangle graph and lift it into \(\mathbb{R}^3\). These helpers are intended for benchmark families where the topology is the usual triangular gasket but the intended metric comes from a curved or folded geometry rather than the flat equilateral reference drawing.

Usage

sierpinski.triangle.surface.graph(
  level = 2,
  surface = c("flat", "saddle", "paraboloid", "ripple", "folded"),
  amplitude = 0.75,
  freq.u = 1,
  freq.v = 1,
  x.scale = 1,
  y.scale = 1,
  normalize = c("median", "mean", "none")
)

Value

The coords_surface component is an n x 3

numeric matrix with columns x, y, and z.

sierpinski.triangle.surface.graph() returns a list with components:

  • edges: the Sierpinski triangle edges,

  • n: number of vertices,

  • edge_weights: induced positive edge lengths,

  • coords_surface: the 3D surface embedding,

  • coords_param: the canonical 2D triangle coordinates,

  • weight_scale: the normalization constant applied to the raw edge lengths,

  • family: always "sierpinski.triangle",

  • surface: the chosen surface name,

  • level: the recursion depth,

  • label: a human-readable family label.

Arguments

level

Recursion depth. May be 0 or larger.

surface

Triangle surface family. One of "flat", "saddle", "paraboloid", "ripple", or "folded".

amplitude

Finite deformation amplitude.

freq.u

Positive ripple frequency in the first canonical triangle coordinate. Used only when surface = "ripple".

freq.v

Positive ripple frequency in the second canonical triangle coordinate. Used only when surface = "ripple".

x.scale

Positive horizontal scaling applied to the canonical triangle coordinates.

y.scale

Positive vertical scaling applied to the canonical triangle coordinates.

normalize

Normalization applied to the induced edge lengths. One of "median", "mean", or "none".

Examples

Run this code
triangle <- sierpinski.triangle.surface.graph(level = 1)

Run the code above in your browser using DataLab