Weighted Sierpinski triangle surface helpers
Source:R/graph_helpers.R
sierpinski_triangle_surface_helpers.RdConvenience 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.embedding(
level = 2,
surface = c("flat", "saddle", "paraboloid", "ripple", "folded"),
amplitude = 0.75,
freq_u = 1,
freq_v = 1,
x_scale = 1,
y_scale = 1
)
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")
)Arguments
- level
Recursion depth. May be
0or 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".
Value
sierpinski.triangle.surface.embedding() returns 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.