File size: 2,839 Bytes
82a8f4b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import numpy as np
import matplotlib.pyplot as plt
from ideal_poly_volume_toolkit.geometry import delaunay_triangulation_indices

# The golden ratio configuration from seed 42
phi = (1 + np.sqrt(5)) / 2
z_points = np.array([
    0 + 0j,                    # z[0]
    1 + 0j,                    # z[1]
    2.6180 + 0j,              # z[2] ≈ φ²
    0.5 - 1.5388j,            # z[3] 
    2.8917 - 2.6037j,         # z[4]
    0.5 + 1.5388j,            # z[5]
    -1.6180 + 0j              # z[6] ≈ -φ
])

# Get Delaunay triangulation
triangles = delaunay_triangulation_indices(z_points)

# Complex plane view with Delaunay triangulation
plt.figure(figsize=(10, 10))

# Plot points
real_coords = z_points.real
imag_coords = z_points.imag
plt.scatter(real_coords, imag_coords, s=200, c='red', zorder=5)

# Label points
for i, z in enumerate(z_points):
    offset = 0.15
    plt.annotate(f'z[{i}]', (z.real + offset, z.imag + offset), fontsize=12)

# Draw Delaunay triangles
for tri in triangles:
    # Close the triangle by adding the first point at the end
    triangle_x = [real_coords[tri[j]] for j in range(3)] + [real_coords[tri[0]]]
    triangle_y = [imag_coords[tri[j]] for j in range(3)] + [imag_coords[tri[0]]]
    plt.plot(triangle_x, triangle_y, 'b-', linewidth=1.5)

plt.xlabel('Real', fontsize=14)
plt.ylabel('Imaginary', fontsize=14)
plt.title('Golden Ratio Configuration in Complex Plane\nwith Delaunay Triangulation', fontsize=16)
plt.grid(True, alpha=0.3)
plt.axis('equal')

# Add circles at special radii
circle1 = plt.Circle((0, 0), phi, fill=False, linestyle='--', color='green', alpha=0.5, linewidth=2)
circle2 = plt.Circle((0, 0), phi**2, fill=False, linestyle='--', color='green', alpha=0.5, linewidth=2)
plt.gca().add_patch(circle1)
plt.gca().add_patch(circle2)
plt.text(0.1, phi + 0.2, f'r = φ ≈ {phi:.3f}', color='green', fontsize=12)
plt.text(0.1, phi**2 + 0.2, f'r = φ² ≈ {phi**2:.3f}', color='green', fontsize=12)

plt.tight_layout()
plt.savefig('golden_config_plane.png', dpi=150, bbox_inches='tight')
print("Saved: golden_config_plane.png")

# Print configuration details
print("\nConfiguration details:")
print(f"Number of vertices: {len(z_points)} (plus infinity)")
print(f"Number of triangles: {len(triangles)}")
print("\nTriangulation:")
for i, tri in enumerate(triangles):
    print(f"  Triangle {i}: vertices {tri}")

# Analyze special values
print("\nSpecial values in configuration:")
print(f"  φ = {phi:.6f}")
print(f"  φ² = {phi**2:.6f}")
print(f"  1/φ = {1/phi:.6f}")
print(f"  0.5 = 1/2")
print(f"  1.5388 ≈ √(5/2) = {np.sqrt(5/2):.4f}? No, = {1.5388:.4f}")
print(f"  1.5388 ≈ φ - 1/(2φ) = {phi - 1/(2*phi):.4f}? Close!")

# Check if z[3] and z[5] are special
z3_abs = abs(0.5 - 1.5388j)
z5_abs = abs(0.5 + 1.5388j)
print(f"\n|z[3]| = |z[5]| = {z3_abs:.6f} = φ")

plt.close()