-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathriemann_sphere.007
More file actions
74 lines (62 loc) · 2.42 KB
/
Copy pathriemann_sphere.007
File metadata and controls
74 lines (62 loc) · 2.42 KB
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
-- SPDX-License-Identifier: MPL-2.0
-- CONFIDENTIAL — EXPERIMENTAL — NOT FOR DISTRIBUTION
--
-- Riemann Sphere Construction via log(e)
--
-- The Riemann sphere is C ∪ {∞} mapped to S² via stereographic projection.
-- The key identity: log(e) = 1, which gives us the unit point.
--
-- Stereographic projection from (x, y) in C to (X, Y, Z) on S²:
-- X = 2x / (1 + x² + y²)
-- Y = 2y / (1 + x² + y²)
-- Z = (x² + y² - 1) / (1 + x² + y²)
--
-- North pole (0, 0, 1) maps to ∞.
-- South pole (0, 0, -1) maps to origin (0, 0).
-- The unit circle |z| = 1 maps to the equator Z = 0.
-- log(e) = 1: the fundamental identity
@total data log_e = ln(exp(1.0))
-- Stereographic projection
@pure fn stereo_x(x: Float, y: Float) -> Float {
return 2.0 * x / (1.0 + x * x + y * y)
}
@pure fn stereo_y(x: Float, y: Float) -> Float {
return 2.0 * y / (1.0 + x * x + y * y)
}
@pure fn stereo_z(x: Float, y: Float) -> Float {
return (x * x + y * y - 1.0) / (1.0 + x * x + y * y)
}
-- The unit point: z = log(e) = 1 + 0i
-- Maps to (X, Y, Z) on the sphere
@total data unit_x = stereo_x(log_e, 0.0)
@total data unit_y = stereo_y(log_e, 0.0)
@total data unit_z = stereo_z(log_e, 0.0)
-- Verify it's on the sphere: X² + Y² + Z² = 1
@total data sphere_check = unit_x * unit_x + unit_y * unit_y + unit_z * unit_z
-- Origin: z = 0 → south pole (0, 0, -1)
@total data origin_x = stereo_x(0.0, 0.0)
@total data origin_y = stereo_y(0.0, 0.0)
@total data origin_z = stereo_z(0.0, 0.0)
-- Unit circle points: |z| = 1 → equator (Z = 0)
@total data circle_pt1_x = stereo_x(1.0, 0.0)
@total data circle_pt1_z = stereo_z(1.0, 0.0)
@total data circle_pt2_x = stereo_x(0.0, 1.0)
@total data circle_pt2_z = stereo_z(0.0, 1.0)
-- e^(iπ) + 1 = 0 (Euler's identity)
-- e^(iπ) = -1 + 0i → maps to (-1, 0, 0) on sphere
@total data euler_x = stereo_x(neg(1.0), 0.0)
@total data euler_y = stereo_y(neg(1.0), 0.0)
@total data euler_z = stereo_z(neg(1.0), 0.0)
-- The i point: z = i = 0 + 1i → maps to (0, 1, 0) on sphere
@total data i_x = stereo_x(0.0, 1.0)
@total data i_y = stereo_y(0.0, 1.0)
@total data i_z = stereo_z(0.0, 1.0)
-- Summary of key points on the Riemann sphere
@total data sphere = {
log_e: log_e,
unit_point: { x: unit_x, y: unit_y, z: unit_z },
origin: { x: origin_x, y: origin_y, z: origin_z },
euler_point: { x: euler_x, y: euler_y, z: euler_z },
i_point: { x: i_x, y: i_y, z: i_z },
sphere_check: sphere_check
}