Weighted irregular sphere surface helpers
Source:R/graph_helpers.R
irregular_sphere_surface_helpers.RdConvenience helpers that build a sphere from deterministically irregular latitude bands with varying sample counts, stitch adjacent bands into a locally triangulated graph, and then realize that graph in \(\mathbb{R}^3\) using either a standard sphere, an ellipsoid, or a wavy radial modulation.
Usage
irregular.sphere.surface.embedding(
bands = 6,
equator_count = 28,
count_irregularity = 0.2,
lat_irregularity = 0.35,
phase_twist = 0.35,
surface = c("standard", "ellipsoid", "wavy"),
radius = 1,
amplitude = 0.2,
freq_theta = 3,
freq_lat = 2,
twist = 0.25
)
irregular.sphere.surface.graph(
bands = 6,
equator_count = 28,
count_irregularity = 0.2,
lat_irregularity = 0.35,
phase_twist = 0.35,
surface = c("standard", "ellipsoid", "wavy"),
radius = 1,
amplitude = 0.2,
freq_theta = 3,
freq_lat = 2,
twist = 0.25,
normalize = c("median", "mean", "none")
)Arguments
- bands
Number of non-pole latitude bands.
- equator_count
Approximate number of vertices near the equator.
- count_irregularity
Irregularity level for per-band sample counts. Must lie in
[0, 1).- lat_irregularity
Irregularity level for latitude-band spacing. Must lie in
[0, 1].- phase_twist
Finite angular phase offset used to desynchronize neighboring latitude bands.
- surface
Sphere geometry family. One of
"standard","ellipsoid", or"wavy".- radius
Positive baseline radius.
- amplitude
Finite deformation amplitude. For
"ellipsoid", positive values make the shape oblate and negative values make it prolate.- freq_theta
Positive longitudinal frequency used only when
surface = "wavy".- freq_lat
Positive latitudinal frequency used only when
surface = "wavy".- twist
Finite longitude twist applied smoothly by latitude.
- normalize
Normalization applied to the induced edge lengths. One of
"median","mean", or"none".
Value
irregular.sphere.surface.embedding() returns an n x 3 numeric
matrix with columns x, y, and z.
irregular.sphere.surface.graph() returns a list with components:
edges: the irregular sphere edges,n: number of vertices,edge_weights: induced positive edge lengths,coords_surface: the 3D embedding,coords_param: the irregular angular parameter coordinates,weight_scale: the normalization constant applied to the raw edge lengths,family: always"irregular.sphere",surface: the chosen surface name,bands: number of non-pole latitude bands,band_sizes: sample counts in each latitude band,label: a human-readable family label.