feat: add phi-harmonic spiral visualization of lattice periodic table
This commit is contained in:
@@ -96,6 +96,8 @@ results/s2-examine/
|
||||
|
||||
# --- PNG output ---
|
||||
*.png
|
||||
# Exception: spiral graphic in docs/
|
||||
!docs/lattice-periodic-spiral.png
|
||||
|
||||
# --- Numpy arrays (experiment output) ---
|
||||
*.npy
|
||||
@@ -111,5 +113,8 @@ golden-weave-experiments/
|
||||
training/
|
||||
*.jsonl
|
||||
|
||||
# --- VS Code local config ---
|
||||
.vscode/
|
||||
|
||||
# --- Archive (removed) ---
|
||||
archive/
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
import os
|
||||
|
||||
# Load data
|
||||
script_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
df = pd.read_csv(os.path.join(script_dir, 'lattice-periodic-table.csv'))
|
||||
|
||||
# Golden angle
|
||||
phi = (1 + np.sqrt(5)) / 2
|
||||
golden_angle = np.pi * (3 - np.sqrt(5)) # ≈ 2.39996 radians
|
||||
|
||||
# Calculate positions
|
||||
df['angle'] = df['AtomicNumber'] * golden_angle
|
||||
df['radius'] = (df['AsymmetryValue'] - 13.2) * 10 # scale factor
|
||||
df['x'] = df['radius'] * np.cos(df['angle'])
|
||||
df['y'] = df['radius'] * np.sin(df['angle'])
|
||||
|
||||
# Color by stability
|
||||
colors = {'Stable': '#00aa00', 'Metastable': '#ffaa00', 'Radioactive': '#aa0000'}
|
||||
df['color'] = df['Stability'].map(colors)
|
||||
|
||||
# Size by valency
|
||||
df['size'] = (df['ValencyLobes'] + 1) * 20
|
||||
|
||||
# Plot
|
||||
fig, ax = plt.subplots(figsize=(16, 16))
|
||||
scatter = ax.scatter(df['x'], df['y'], c=df['color'], s=df['size'], alpha=0.7)
|
||||
|
||||
# Add element symbols
|
||||
for idx, row in df.iterrows():
|
||||
ax.annotate(row['Symbol'], (row['x'], row['y']), fontsize=8, ha='center')
|
||||
|
||||
# Fibonacci spiral overlay
|
||||
theta = np.linspace(0, 4*np.pi, 1000)
|
||||
r = np.exp(theta / (2*np.pi) * np.log(phi))
|
||||
ax.plot(r * np.cos(theta), r * np.sin(theta), 'k--', alpha=0.3, linewidth=1)
|
||||
|
||||
ax.set_aspect('equal')
|
||||
ax.axis('off')
|
||||
plt.title('Lattice Physics Periodic Table — Phi-Harmonic Spiral', fontsize=16)
|
||||
plt.savefig(os.path.join(script_dir, 'lattice-periodic-spiral.png'), dpi=300, bbox_inches='tight')
|
||||
plt.savefig(os.path.join(script_dir, 'lattice-periodic-spiral.svg'), format='svg')
|
||||
print("Generated: lattice-periodic-spiral.png + .svg")
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 437 KiB |
File diff suppressed because it is too large
Load Diff
|
After Width: | Height: | Size: 132 KiB |
Reference in New Issue
Block a user