coordinate-system 5.2.1__tar.gz → 6.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. coordinate_system-6.0.0/PKG-INFO +783 -0
  2. coordinate_system-6.0.0/README.md +741 -0
  3. coordinate_system-6.0.0/coordinate_system/__init__.py +269 -0
  4. coordinate_system-6.0.0/coordinate_system/differential_geometry.py +986 -0
  5. coordinate_system-6.0.0/coordinate_system/fourier_spectral.py +125 -0
  6. coordinate_system-6.0.0/coordinate_system/qframes.py +792 -0
  7. coordinate_system-6.0.0/coordinate_system/visualization.py +1069 -0
  8. coordinate_system-6.0.0/coordinate_system.egg-info/PKG-INFO +783 -0
  9. {coordinate_system-5.2.1 → coordinate_system-6.0.0}/coordinate_system.egg-info/SOURCES.txt +1 -3
  10. {coordinate_system-5.2.1 → coordinate_system-6.0.0}/setup.py +4 -4
  11. coordinate_system-5.2.1/MATHEMATICAL_FOUNDATION.md +0 -800
  12. coordinate_system-5.2.1/PKG-INFO +0 -807
  13. coordinate_system-5.2.1/README.md +0 -765
  14. coordinate_system-5.2.1/coordinate_system/__init__.py +0 -301
  15. coordinate_system-5.2.1/coordinate_system/curvature.py +0 -321
  16. coordinate_system-5.2.1/coordinate_system/differential_geometry.py +0 -666
  17. coordinate_system-5.2.1/coordinate_system/fourier_frames.py +0 -530
  18. coordinate_system-5.2.1/coordinate_system/fourier_spectral.py +0 -376
  19. coordinate_system-5.2.1/coordinate_system/visualization.py +0 -666
  20. coordinate_system-5.2.1/coordinate_system.egg-info/PKG-INFO +0 -807
  21. {coordinate_system-5.2.1 → coordinate_system-6.0.0}/LICENSE +0 -0
  22. {coordinate_system-5.2.1 → coordinate_system-6.0.0}/MANIFEST.in +0 -0
  23. {coordinate_system-5.2.1 → coordinate_system-6.0.0}/coordinate_system/curve_interpolation.py +0 -0
  24. {coordinate_system-5.2.1 → coordinate_system-6.0.0}/coordinate_system.egg-info/dependency_links.txt +0 -0
  25. {coordinate_system-5.2.1 → coordinate_system-6.0.0}/coordinate_system.egg-info/not-zip-safe +0 -0
  26. {coordinate_system-5.2.1 → coordinate_system-6.0.0}/coordinate_system.egg-info/requires.txt +0 -0
  27. {coordinate_system-5.2.1 → coordinate_system-6.0.0}/coordinate_system.egg-info/top_level.txt +0 -0
  28. {coordinate_system-5.2.1 → coordinate_system-6.0.0}/coordinate_system_binding.cpp +0 -0
  29. {coordinate_system-5.2.1 → coordinate_system-6.0.0}/pmsys_minimal.hpp +0 -0
  30. {coordinate_system-5.2.1 → coordinate_system-6.0.0}/setup.cfg +0 -0
@@ -0,0 +1,783 @@
1
+ Metadata-Version: 2.1
2
+ Name: coordinate_system
3
+ Version: 6.0.0
4
+ Summary: High-performance 3D coordinate system library with unified differential geometry, quantum frame algebra, spectral transforms, and professional curvature visualization
5
+ Home-page: https://github.com/panguojun/Coordinate-System
6
+ Author: PanGuoJun
7
+ Author-email: 18858146@qq.com
8
+ License: MIT
9
+ Project-URL: Bug Reports, https://github.com/panguojun/Coordinate-System/issues
10
+ Project-URL: Source, https://github.com/panguojun/Coordinate-System
11
+ Project-URL: Documentation, https://github.com/panguojun/Coordinate-System/blob/main/README.md
12
+ Keywords: 3d math vector quaternion coordinate-system geometry graphics spatial-computing differential-geometry curvature curve-interpolation c2-continuity frenet-frames fourier-transform operator-overloading quantum-coordinates heisenberg-uncertainty visualization rgb-frames catmull-rom squad intrinsic-gradient spectral-analysis surface-visualization
13
+ Platform: Windows
14
+ Platform: Linux
15
+ Platform: macOS
16
+ Platform: Android
17
+ Platform: iOS
18
+ Classifier: Development Status :: 5 - Production/Stable
19
+ Classifier: Intended Audience :: Developers
20
+ Classifier: Intended Audience :: Science/Research
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
23
+ Classifier: Topic :: Multimedia :: Graphics :: 3D Modeling
24
+ Classifier: License :: OSI Approved :: MIT License
25
+ Classifier: Programming Language :: Python :: 3
26
+ Classifier: Programming Language :: Python :: 3.7
27
+ Classifier: Programming Language :: Python :: 3.8
28
+ Classifier: Programming Language :: Python :: 3.9
29
+ Classifier: Programming Language :: Python :: 3.10
30
+ Classifier: Programming Language :: Python :: 3.11
31
+ Classifier: Programming Language :: Python :: 3.12
32
+ Classifier: Programming Language :: Python :: 3.13
33
+ Classifier: Programming Language :: C++
34
+ Classifier: Operating System :: Microsoft :: Windows
35
+ Classifier: Operating System :: POSIX :: Linux
36
+ Classifier: Operating System :: MacOS
37
+ Requires-Python: >=3.7
38
+ Description-Content-Type: text/markdown
39
+ License-File: LICENSE
40
+ Requires-Dist: numpy>=1.19.0
41
+ Requires-Dist: matplotlib>=3.3.0
42
+
43
+ # Coordinate System Library
44
+
45
+ **High-performance 3D coordinate system and differential geometry library for Python**
46
+
47
+ [![PyPI version](https://badge.fury.io/py/coordinate-system.svg)](https://pypi.org/project/coordinate-system/)
48
+ [![Python](https://img.shields.io/pypi/pyversions/coordinate-system.svg)](https://pypi.org/project/coordinate-system/)
49
+ [![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20Linux%20%7C%20macOS-blue.svg)](https://pypi.org/project/coordinate-system/)
50
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
51
+
52
+ **Author:** PanGuoJun
53
+ **Version:** 6.0.0
54
+ **License:** MIT
55
+
56
+ ---
57
+
58
+ ## 🆕 What's New in v6.0.0 (2025-12-03)
59
+
60
+ ### Major Architecture Refactoring
61
+
62
+ **Unified Differential Geometry Module** - Complete integration of curvature computation methods
63
+
64
+ - **Merged Module**: `differential_geometry.py` now contains both classical and intrinsic gradient methods
65
+ - **Dual Method Support**:
66
+ - Intrinsic gradient method (default): `compute_gaussian_curvature()`, `compute_mean_curvature()`
67
+ - Classical method: `gaussian_curvature_classical()`, `mean_curvature_classical()`
68
+ - **Backward Compatibility**: Old function names still work as aliases
69
+ - **High-Order Finite Differences**: 5-point formulas with O(h⁴) accuracy
70
+ - **All English Documentation**: Complete internationalization for global distribution
71
+
72
+ **Unified Quantum Frame Module** - Complex frame algebra with spectral analysis
73
+
74
+ - **Merged Module**: `qframes.py` combines complex quantum frames with Fourier spectral transforms
75
+ - **Core Concept**: Q ∈ ℂ as quantum scale factor
76
+ - **Integrated Spectral Transforms**: Now part of QFrame class methods
77
+ - **Dirac Notation**: Moved to optional export (incompatible with complex frame symbols)
78
+ - **GPU Acceleration**: CuPy support for large-scale spectral computations
79
+ - **Cleaner API**: Single unified interface for quantum frame operations
80
+
81
+ **Enhanced Visualization Module** - Professional surface and curvature rendering
82
+
83
+ - **New Class**: `SurfaceVisualizer` with curvature coloring support
84
+ - **Curvature Visualization**: Diverging colormap (blue-white-red) for Gaussian/Mean curvature
85
+ - **Surface Frame Fields**: RGB-coded tangent frames (red=u direction, green=v direction, blue=normal)
86
+ - **Enhanced Curve Rendering**: Binormal support, improved styling
87
+ - **Integration**: Direct support for differential_geometry surfaces
88
+ - **Convenience Functions**: `visualize_surface()` for quick visualization
89
+
90
+ ### Breaking Changes
91
+
92
+ - `curvature.py` removed - functionality merged into `differential_geometry.py`
93
+ - `qframesnew.py` removed - functionality merged into `qframes.py`
94
+ - `fourier_spectral.py` now a compatibility wrapper with deprecation warnings
95
+ - Default curvature methods now use intrinsic gradient (more accurate for complex surfaces)
96
+
97
+ ### Migration Guide
98
+
99
+ ```python
100
+ # Old code (still works with deprecation warnings):
101
+ from coordinate_system import fourier_spectral
102
+ from coordinate_system import curvature
103
+
104
+ # New code (recommended):
105
+ from coordinate_system import qframes
106
+ from coordinate_system import differential_geometry
107
+
108
+ # Or use the unified imports:
109
+ from coordinate_system import (
110
+ QFrame, spectral_transform, inverse_spectral_transform,
111
+ compute_gaussian_curvature, compute_mean_curvature,
112
+ SurfaceVisualizer, visualize_surface
113
+ )
114
+ ```
115
+
116
+ ---
117
+
118
+ ## What's New in v5.2.1 (2025-12-01)
119
+
120
+ ### Fourier Frames with Operator Overloading
121
+
122
+ **Module: `fourier_frames`** - Elegant quantum coordinate transformations
123
+
124
+ - **Operator Overloading Support**: Intuitive syntax for Fourier transforms
125
+ - `F_p @ psi` - Matrix multiplication operator
126
+ - `F_p * psi` - Multiplication operator
127
+ - `psi | F_p` - Bra-ket notation
128
+ - `~F_x` - Dual frame operator
129
+ - **Quantum State Representation**: `QuantumState` and `StateVector` classes
130
+ - **Heisenberg Uncertainty**: Built-in uncertainty principle computations
131
+ - **Position <-> Momentum Transforms**: Seamless coordinate basis transformations
132
+
133
+ ### C2-Continuous Curve Interpolation
134
+
135
+ **Module: `curve_interpolation`** - Second-order smooth curves
136
+
137
+ - **C2-Continuity**: Catmull-Rom spline for position interpolation
138
+ - **SQUAD Interpolation**: Spherical Quadrangle for smooth quaternion interpolation
139
+ - **13x Smoother**: Reduced maximum curvature from 13.93 to 1.05
140
+
141
+ ### Handedness Control
142
+
143
+ - ✨ **New**: C++ level handedness control (`set_handedness('left'/'right')`)
144
+ - 🔧 **Fixed**: Frenet frames now respect coordinate system handedness
145
+ - 📚 **Improved**: Global handedness setting for consistent behavior
146
+
147
+ ---
148
+
149
+ ## Features
150
+
151
+ ### Core Components
152
+
153
+ **C++ Performance Layer:**
154
+ - **vec3** - 3D vector with comprehensive operations
155
+ - **vec2** - 2D vector for parametric coordinates
156
+ - **quat** - Quaternion for 3D rotations
157
+ - **coord3** - Complete 3D coordinate system (position, rotation, scale)
158
+
159
+ **Advanced Mathematics Modules:**
160
+ - **differential_geometry** - Surface analysis with dual curvature methods
161
+ - **qframes** - Quantum frame algebra with spectral transforms
162
+ - **visualization** - Professional 3D rendering for geometry and curvature
163
+ - **curve_interpolation** - C2-continuous curve and frame interpolation
164
+
165
+ ### Operations
166
+
167
+ - Vector arithmetic (+, -, *, /)
168
+ - Dot product, cross product (left-handed system)
169
+ - Vector projection, reflection
170
+ - Linear interpolation (lerp)
171
+ - Spherical linear interpolation (slerp)
172
+ - Coordinate system transformations
173
+ - Euler angle conversion
174
+ - Gaussian and mean curvature computation
175
+ - Spectral analysis and Fourier transforms
176
+
177
+ ### Performance
178
+
179
+ - Written in optimized C++17
180
+ - Python bindings via pybind11
181
+ - Over 1,000,000 operations per second
182
+ - GPU acceleration for spectral transforms (optional)
183
+
184
+ ### Platform Support
185
+
186
+ - ✅ Windows (7, 10, 11)
187
+ - ✅ Linux (Ubuntu, Debian, CentOS, etc.)
188
+ - ✅ macOS (10.14+)
189
+
190
+ ---
191
+
192
+ ## 📚 Documentation
193
+
194
+ ### Mathematical Foundation
195
+
196
+ For a comprehensive understanding of the mathematical principles behind coordinate systems, vectors, quaternions, and differential geometry, see our detailed guide:
197
+
198
+ **[📖 Mathematical Foundation of Coordinate Systems](https://github.com/panguojun/Coordinate-System)**
199
+
200
+ ### Module Documentation
201
+
202
+ - [Curve Interpolation Guide](CURVE_INTERPOLATION_README.md)
203
+ - [C2 Interpolation Guide](C2_INTERPOLATION_GUIDE.md)
204
+
205
+ ---
206
+
207
+ ## Installation
208
+
209
+ ### From PyPI (Recommended)
210
+
211
+ ```bash
212
+ pip install coordinate-system
213
+ ```
214
+
215
+ ### From Source
216
+
217
+ ```bash
218
+ git clone https://github.com/panguojun/Coordinate-System.git
219
+ cd Coordinate-System
220
+ pip install .
221
+ ```
222
+
223
+ ---
224
+
225
+ ## Quick Start
226
+
227
+ ```python
228
+ from coordinate_system import vec3, quat, coord3
229
+
230
+ # Create vectors
231
+ v1 = vec3(1, 2, 3)
232
+ v2 = vec3(4, 5, 6)
233
+
234
+ # Vector operations
235
+ v3 = v1 + v2 # Addition: vec3(5, 7, 9)
236
+ dot = v1.dot(v2) # Dot product: 32.0
237
+ cross = v1.cross(v2) # Cross product (left-handed)
238
+ length = v1.length() # Length: 3.742
239
+ normalized = v1.normcopy() # Unit vector
240
+
241
+ # Quaternion rotation
242
+ axis = vec3(0, 0, 1) # Z axis
243
+ q = quat(1.5708, axis) # 90 degrees rotation
244
+ rotated = q * v1 # Rotate v1
245
+
246
+ # Coordinate systems
247
+ frame = coord3.from_angle(1.57, vec3(0, 0, 1)) # Frame rotated 90°
248
+ world_pos = v1 * frame # Transform to world space
249
+ local_pos = world_pos / frame # Transform back to local
250
+
251
+ # Differential geometry
252
+ from coordinate_system import Sphere, compute_gaussian_curvature
253
+
254
+ sphere = Sphere(radius=1.0)
255
+ K = compute_gaussian_curvature(sphere, u=0.5, v=0.5) # K = 1.0 for unit sphere
256
+
257
+ # Visualization
258
+ from coordinate_system import visualize_surface
259
+
260
+ visualize_surface(sphere, curvature_type='gaussian', show_colorbar=True)
261
+ ```
262
+
263
+ ---
264
+
265
+ ## Module Guide
266
+
267
+ ### Core Classes (C++ Bindings)
268
+
269
+ #### vec3 - 3D Vector
270
+
271
+ ```python
272
+ from coordinate_system import vec3
273
+
274
+ # Constructors
275
+ v = vec3() # Zero vector (0, 0, 0)
276
+ v = vec3(x, y, z) # Vector with components
277
+
278
+ # Operations
279
+ v3 = v1 + v2 # Addition
280
+ dot = v1.dot(v2) # Dot product
281
+ cross = v1.cross(v2) # Cross product (left-handed)
282
+ length = v.length() # Vector length
283
+ v.normalize() # Normalize in-place
284
+ normalized = v.normcopy() # Return normalized copy
285
+
286
+ # Static methods
287
+ v = vec3.lerp(a, b, t) # Linear interpolation
288
+ angle = vec3.angle(a, b) # Angle between vectors
289
+ ```
290
+
291
+ #### quat - Quaternion
292
+
293
+ ```python
294
+ from coordinate_system import quat
295
+
296
+ # Constructors
297
+ q = quat() # Identity quaternion
298
+ q = quat(w, x, y, z) # From components
299
+ q = quat(angle, axis) # From angle-axis
300
+ q = quat(v1, v2) # From two vectors
301
+
302
+ # Operations
303
+ q3 = q1 * q2 # Quaternion multiplication
304
+ v_rotated = q * v # Rotate vector
305
+ conj = q.conj() # Conjugate
306
+
307
+ # Conversion
308
+ q.from_eulers(pitch, yaw, roll) # From Euler angles
309
+ ```
310
+
311
+ #### coord3 - 3D Coordinate System
312
+
313
+ ```python
314
+ from coordinate_system import coord3
315
+
316
+ # Constructors
317
+ c = coord3() # Identity frame
318
+ c = coord3(x, y, z) # Position only
319
+ c = coord3(position, quaternion, scale) # Full specification
320
+
321
+ # Factory methods
322
+ c = coord3.identity() # Identity at origin
323
+ c = coord3.from_position(pos) # At position
324
+ c = coord3.from_angle(angle, axis) # From angle-axis
325
+ c = coord3.look_at(eye, target, up) # Look-at transformation
326
+
327
+ # Transformations
328
+ world_pos = local_pos * coord # Local to world
329
+ local_pos = world_pos / coord # World to local
330
+ c3 = c1 * c2 # Compose transformations
331
+ ```
332
+
333
+ ### Differential Geometry Module
334
+
335
+ ```python
336
+ from coordinate_system import (
337
+ # Surface classes
338
+ Surface, Sphere, Torus,
339
+
340
+ # Intrinsic gradient method (default, more accurate)
341
+ compute_gaussian_curvature,
342
+ compute_mean_curvature,
343
+ compute_riemann_curvature,
344
+ compute_all_curvatures,
345
+
346
+ # Classical method (high-order finite differences)
347
+ gaussian_curvature_classical,
348
+ mean_curvature_classical,
349
+ principal_curvatures_classical,
350
+
351
+ # Method comparison
352
+ compare_methods,
353
+ )
354
+
355
+ # Create a surface
356
+ sphere = Sphere(radius=2.0)
357
+ torus = Torus(major_radius=3.0, minor_radius=1.0)
358
+
359
+ # Compute curvature (intrinsic gradient method)
360
+ K = compute_gaussian_curvature(sphere, u=0.5, v=0.5)
361
+ H = compute_mean_curvature(sphere, u=0.5, v=0.5)
362
+
363
+ # Use classical method
364
+ K_classical = gaussian_curvature_classical(sphere, u=0.5, v=0.5)
365
+
366
+ # Compare methods
367
+ results = compare_methods(sphere, u=0.5, v=0.5)
368
+ print(f"Intrinsic: K={results['intrinsic']['K']:.6f}")
369
+ print(f"Classical: K={results['classical']['K']:.6f}")
370
+ ```
371
+
372
+ ### Quantum Frame Module
373
+
374
+ ```python
375
+ from coordinate_system import (
376
+ # Core classes
377
+ QFrame, QuantumState, PathIntegral, QFrameSpectrum,
378
+
379
+ # Dirac notation (optional export)
380
+ DiracBra, DiracKet, bra, ket,
381
+
382
+ # Spectral transforms
383
+ spectral_transform, inverse_spectral_transform,
384
+
385
+ # Constants
386
+ HBAR, GPU_AVAILABLE,
387
+ )
388
+
389
+ # Create quantum frame
390
+ qf = QFrame(base_coord=coord3(), q_factor=1.0+0j)
391
+
392
+ # Fourier transform (phase rotation)
393
+ qf_transformed = qf.fourier_transform(theta=np.pi/2)
394
+
395
+ # 2D spectral transform
396
+ import numpy as np
397
+ field = np.random.rand(64, 64, 3) # Random coordinate field
398
+ spectrum = QFrame.spectral_transform_2d(field)
399
+ reconstructed = QFrame.inverse_spectral_transform_2d(spectrum)
400
+
401
+ # Path integral
402
+ path = PathIntegral()
403
+ integral = path.integrate_trajectory([qf1, qf2, qf3])
404
+ ```
405
+
406
+ ### Visualization Module
407
+
408
+ ```python
409
+ from coordinate_system import (
410
+ CoordinateSystemVisualizer,
411
+ CurveVisualizer,
412
+ SurfaceVisualizer,
413
+ visualize_coord_system,
414
+ visualize_curve,
415
+ visualize_surface,
416
+ )
417
+
418
+ # Quick surface visualization with curvature
419
+ from coordinate_system import Sphere
420
+
421
+ sphere = Sphere(radius=1.0)
422
+ visualize_surface(
423
+ sphere,
424
+ curvature_type='gaussian', # or 'mean'
425
+ show_colorbar=True,
426
+ show_normals=False,
427
+ show_frames=True,
428
+ title='Sphere with Gaussian Curvature'
429
+ )
430
+
431
+ # Advanced surface visualization
432
+ vis = SurfaceVisualizer(figsize=(12, 10), dpi=120)
433
+ vis.draw_surface_curvature(
434
+ sphere,
435
+ curvature_type='gaussian',
436
+ u_range=(0, 2*np.pi),
437
+ v_range=(0, np.pi),
438
+ nu=60, nv=40,
439
+ alpha=0.9,
440
+ show_colorbar=True
441
+ )
442
+ vis.draw_surface_frames(
443
+ sphere,
444
+ u_range=(0, 2*np.pi),
445
+ v_range=(0, np.pi),
446
+ density=8,
447
+ arrow_length=0.3
448
+ )
449
+ vis.set_view(elev=30, azim=45)
450
+ vis.set_title('Sphere with Frame Field')
451
+ vis.show()
452
+ ```
453
+
454
+ ### Curve Interpolation Module
455
+
456
+ ```python
457
+ from coordinate_system import (
458
+ InterpolatedCurve,
459
+ generate_frenet_frames,
460
+ frame_field_spline_c2,
461
+ compute_curvature_profile,
462
+ )
463
+
464
+ # Create C2-continuous interpolated curve
465
+ points = [vec3(0, 0, 0), vec3(1, 1, 0), vec3(2, 0, 0), vec3(3, 1, 1)]
466
+ curve = InterpolatedCurve(points, method='c2')
467
+
468
+ # Sample curve
469
+ t_values = np.linspace(0, 1, 100)
470
+ curve_points = [curve.evaluate(t) for t in t_values]
471
+
472
+ # Generate smooth frame field
473
+ frames = frame_field_spline_c2(points, num_samples=100)
474
+
475
+ # Compute curvature
476
+ curvature = compute_curvature_profile(curve_points)
477
+ max_curvature = max(curvature)
478
+ ```
479
+
480
+ ---
481
+
482
+ ## Coordinate System Type
483
+
484
+ This library uses a **left-handed coordinate system** for all vector and quaternion operations (as of v3.0.0).
485
+
486
+ ```
487
+ +Y
488
+ |
489
+ |
490
+ |
491
+ +-----> +X
492
+ \
493
+ \
494
+ +Z
495
+ ```
496
+
497
+ **Left-Hand Rule:**
498
+ - Point your left hand's fingers along the +X axis
499
+ - Curl them toward the +Y axis
500
+ - Your thumb points along the +Z axis
501
+ - Cross product: **X × Y = Z** (common in computer graphics)
502
+
503
+ ---
504
+
505
+ ## Advanced Examples
506
+
507
+ ### Surface Curvature Analysis
508
+
509
+ ```python
510
+ from coordinate_system import Torus, compute_all_curvatures, visualize_surface
511
+ import numpy as np
512
+
513
+ # Create a torus
514
+ torus = Torus(major_radius=3.0, minor_radius=1.0)
515
+
516
+ # Compute all curvatures at a point
517
+ u, v = np.pi/4, np.pi/3
518
+ curvatures = compute_all_curvatures(torus, u, v)
519
+
520
+ print(f"Gaussian curvature: {curvatures['K']:.6f}")
521
+ print(f"Mean curvature: {curvatures['H']:.6f}")
522
+ print(f"Principal curvatures: κ1={curvatures['k1']:.6f}, κ2={curvatures['k2']:.6f}")
523
+
524
+ # Visualize with curvature coloring
525
+ visualize_surface(
526
+ torus,
527
+ curvature_type='gaussian',
528
+ u_range=(0, 2*np.pi),
529
+ v_range=(0, 2*np.pi),
530
+ show_colorbar=True,
531
+ title='Torus Gaussian Curvature'
532
+ )
533
+ ```
534
+
535
+ ### Quantum Frame Spectral Analysis
536
+
537
+ ```python
538
+ from coordinate_system import QFrame, coord3, vec3
539
+ import numpy as np
540
+
541
+ # Create a coordinate field
542
+ coords = []
543
+ for i in range(16):
544
+ for j in range(16):
545
+ x, y = i/16.0, j/16.0
546
+ z = np.sin(2*np.pi*x) * np.cos(2*np.pi*y)
547
+ c = coord3(vec3(x, y, z))
548
+ coords.append(c)
549
+
550
+ coords = np.array(coords).reshape(16, 16)
551
+
552
+ # Convert to QFrame field
553
+ qframes = [[QFrame(c) for c in row] for row in coords]
554
+
555
+ # Extract position field for spectral analysis
556
+ field = np.array([[[qf.base.o.x, qf.base.o.y, qf.base.o.z]
557
+ for qf in row] for row in qframes])
558
+
559
+ # Perform spectral transform
560
+ spectrum = QFrame.spectral_transform_2d(field)
561
+
562
+ # Analyze frequency components
563
+ power_spectrum = np.abs(spectrum)**2
564
+ print(f"Total power: {np.sum(power_spectrum):.6f}")
565
+ ```
566
+
567
+ ### Camera System with Coordinate Frames
568
+
569
+ ```python
570
+ from coordinate_system import vec3, quat, coord3
571
+ import math
572
+
573
+ class Camera:
574
+ def __init__(self, position, target, up=vec3(0, 1, 0)):
575
+ self.frame = coord3.look_at(position, target, up)
576
+
577
+ def move_forward(self, distance):
578
+ self.frame.o = self.frame.o + self.frame.uz * distance
579
+
580
+ def orbit(self, angle_h, angle_v):
581
+ q_h = quat(angle_h, vec3(0, 1, 0))
582
+ q_v = quat(angle_v, self.frame.ux)
583
+ self.frame.rot(q_h)
584
+ self.frame.rot(q_v)
585
+
586
+ def get_view_matrix(self):
587
+ """Get view matrix for rendering"""
588
+ return self.frame
589
+
590
+ # Usage
591
+ cam = Camera(vec3(0, 5, 10), vec3(0, 0, 0))
592
+ cam.orbit(0.1, 0) # Orbit horizontally
593
+ cam.move_forward(1.0) # Move forward
594
+ view = cam.get_view_matrix()
595
+ ```
596
+
597
+ ---
598
+
599
+ ## Performance
600
+
601
+ Benchmark on Intel i7-10700K @ 3.8GHz:
602
+
603
+ | Operation | Ops/second | Notes |
604
+ |-----------|-----------|-------|
605
+ | Vector addition | 5,200,000 | C++ optimized |
606
+ | Dot product | 4,800,000 | C++ optimized |
607
+ | Cross product | 3,500,000 | C++ optimized |
608
+ | Normalize | 2,100,000 | C++ optimized |
609
+ | Quaternion rotation | 1,800,000 | C++ optimized |
610
+ | Gaussian curvature | 85,000 | Python + NumPy |
611
+ | Spectral transform (CPU) | 1,200/sec | 64×64 field |
612
+ | Spectral transform (GPU) | 12,000/sec | 64×64 field, CuPy |
613
+
614
+ ---
615
+
616
+ ## Constants
617
+
618
+ ```python
619
+ from coordinate_system import ZERO3, UNITX, UNITY, UNITZ, ONE3, ONE4, ONEC
620
+
621
+ ZERO3 # Zero vector vec3(0, 0, 0)
622
+ UNITX # Unit X vector vec3(1, 0, 0)
623
+ UNITY # Unit Y vector vec3(0, 1, 0)
624
+ UNITZ # Unit Z vector vec3(0, 0, 1)
625
+ ONE3 # Unit scale vec3(1, 1, 1)
626
+ ONE4 # Identity quaternion quat(1, 0, 0, 0)
627
+ ONEC # World coordinate system coord3()
628
+ ```
629
+
630
+ ---
631
+
632
+ ## Building from Source
633
+
634
+ ### Prerequisites
635
+
636
+ - C++17 compatible compiler
637
+ - Python 3.7+
638
+ - pybind11
639
+
640
+ ### Windows
641
+
642
+ ```bash
643
+ # Install Visual Studio 2019+ with C++ tools
644
+ pip install pybind11 wheel
645
+ python setup.py build
646
+ python setup.py bdist_wheel
647
+ ```
648
+
649
+ ### Linux
650
+
651
+ ```bash
652
+ sudo apt install build-essential python3-dev
653
+ pip3 install pybind11 wheel
654
+ python3 setup.py build
655
+ python3 setup.py bdist_wheel
656
+ ```
657
+
658
+ ### macOS
659
+
660
+ ```bash
661
+ xcode-select --install
662
+ pip3 install pybind11 wheel
663
+ python3 setup.py build
664
+ python3 setup.py bdist_wheel
665
+ ```
666
+
667
+ ---
668
+
669
+ ## System Compatibility
670
+
671
+ ### Operating Systems
672
+
673
+ | Platform | Status | Notes |
674
+ |----------|--------|-------|
675
+ | Windows 7+ | ✅ Full Support | Tested on Windows 10/11 |
676
+ | Linux | ✅ Full Support | Ubuntu 18.04+, CentOS 7+, Debian 9+ |
677
+ | macOS | ✅ Full Support | macOS 10.14 (Mojave) and later |
678
+
679
+ ### Python Versions
680
+
681
+ - Python 3.7
682
+ - Python 3.8
683
+ - Python 3.9
684
+ - Python 3.10
685
+ - Python 3.11
686
+ - Python 3.12
687
+ - Python 3.13
688
+
689
+ ---
690
+
691
+ ## Contributing
692
+
693
+ Contributions are welcome! Please:
694
+
695
+ 1. Fork the repository
696
+ 2. Create a feature branch
697
+ 3. Make your changes
698
+ 4. Add tests
699
+ 5. Submit a pull request
700
+
701
+ ---
702
+
703
+ ## License
704
+
705
+ MIT License - see [LICENSE](LICENSE) file for details
706
+
707
+ Copyright (c) 2024-2025 PanGuoJun
708
+
709
+ ---
710
+
711
+ ## Author
712
+
713
+ **PanGuoJun** (romeosoft)
714
+
715
+ - Email: 18858146@qq.com
716
+ - GitHub: [panguojun/Coordinate-System](https://github.com/panguojun/Coordinate-System)
717
+
718
+ ---
719
+
720
+ ## Links
721
+
722
+ - **PyPI**: https://pypi.org/project/coordinate-system/
723
+ - **GitHub**: https://github.com/panguojun/Coordinate-System
724
+ - **Mathematical Foundation**: [MATHEMATICAL_FOUNDATION.md](https://github.com/panguojun/Coordinate-System/blob/main/MATHEMATICAL_FOUNDATION.md)
725
+ - **Issues**: https://github.com/panguojun/Coordinate-System/issues
726
+
727
+ ---
728
+
729
+ ## Changelog
730
+
731
+ ### Version 6.0.0 (2025-12-03)
732
+ - 🔄 **MAJOR REFACTORING**: Unified module architecture
733
+ - ✨ **Merged differential_geometry**: Combined curvature.py functionality with dual-method support
734
+ - ✨ **Merged qframes**: Integrated qframesnew.py and fourier_spectral.py into unified module
735
+ - ✨ **Enhanced visualization**: Added SurfaceVisualizer with curvature coloring
736
+ - 📚 **Full English documentation**: Complete internationalization
737
+ - ⚡ **Improved API**: Cleaner imports and more intuitive method names
738
+ - 🎨 **Better visualization**: Curvature colormaps, frame field rendering
739
+
740
+ ### Version 5.2.2 (2025-12-01)
741
+ - ✨ C2-continuous curve interpolation with SQUAD
742
+ - ✨ Fourier frames with operator overloading
743
+ - 📚 Enhanced documentation
744
+
745
+ ### Version 5.2.1 (2025-12-01)
746
+ - ✨ Handedness control at C++ level
747
+ - 🔧 Fixed Frenet frame handedness issues
748
+ - 📚 Improved global handedness setting
749
+
750
+ ### Version 4.0.0 (2024-11-15)
751
+ - ✨ Fourier spectral geometry analysis
752
+ - ⚡ GPU acceleration with CuPy
753
+ - 🎯 Topological analysis and Berry phase
754
+ - 📊 ShapeDNA for shape characterization
755
+
756
+ ### Version 3.0.0 (2024-10-20)
757
+ - ⚠️ **BREAKING**: Changed to left-handed coordinate system
758
+ - ✅ Complete test suite validation
759
+ - 📚 Updated all documentation
760
+
761
+ ### Version 1.2.0 (2024-10-22)
762
+ - ✅ Cross-platform support (Windows, Linux, macOS)
763
+ - ✅ Performance optimizations
764
+ - ✅ Improved API consistency
765
+
766
+ ### Version 1.1.0 (2024-09-08)
767
+ - Initial PyPI release
768
+ - Core vec3, quat, coord3 classes
769
+
770
+ ---
771
+
772
+ ## Acknowledgments
773
+
774
+ Built with ❤️ using:
775
+ - **C++17** - High-performance core
776
+ - **pybind11** - Python-C++ bindings
777
+ - **NumPy** - Numerical computations
778
+ - **Matplotlib** - Visualization
779
+ - **CuPy** - Optional GPU acceleration
780
+
781
+ ---
782
+
783
+ **Note**: For the latest updates and documentation, visit the [GitHub repository](https://github.com/panguojun/Coordinate-System).