A high-performance Go implementation for visualizing the Riemann zeta function through spiral plots. This project generates beautiful mathematical visualizations by computing and plotting partial sums of the Riemann zeta function in the complex plane.
- High-Performance Computing: Utilizes multi-threaded computation for calculating partial sums
- Adaptive Downsampling: Intelligent point reduction while maintaining visual quality
- Beautiful Visualizations: Generates high-quality PNG images of zeta function spirals
- Configurable Output: Multiple parameters to customize the visualization
- Memory Efficient: Smart memory management for handling large datasets
- Go 1.23.4 or later
- MacOS (for font loading - can be modified for other platforms)
- Arial Unicode font installed (typically at
/Library/Fonts/Arial Unicode.ttf)
-
Clone the repository:
git clone https://github.com/yourusername/zest-go.git cd zeta-scale-go -
Install dependencies:
go mod download
The main program accepts several command-line flags to customize the visualization:
go run cmd/spiral/main.go [flags]-imag float: Imaginary part of the complex number (default: 6,300,000.0)-maxN int: Maximum number of terms to compute (default: 65,000,000,000)-downsample: Enable downsampling of links (default: false)-aggressive float: Downsampling aggressiveness (0.0-1.0, default: 0.5)-output string: Output filename for the image (default: "combined_links.png")-size int: Output image size in pixels (default: 2048)-debug: Enable debug logging (default: false)-points: Draw points only, no lines (default: false)
-
Basic visualization:
go run cmd/spiral/main.go
-
High-resolution visualization with downsampling:
go run cmd/spiral/main.go -size 4096 -downsample -aggressive 2.0
-
Points-only visualization with custom imaginary part:
go run cmd/spiral/main.go -points -imag 1000000.0
The program includes several optimizations:
- Parallel Processing: Uses Go's concurrency features for computation
- Adaptive Downsampling: Reduces point count while preserving visual quality
- Memory Management: Efficient handling of large datasets
- Worker Pools: Optimized image composition using worker pools
The program uses the Euler-Maclaurin summation formula to compute partial sums of the Riemann zeta function. The computation is split into chunks and processed in parallel using goroutines.
The visualization process includes:
- Complex plane mapping
- Adaptive point interpolation
- Multi-threaded rendering
- Additive blending for smooth visuals
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the [LICENSE] file for details.
- Thanks to the Go team for the excellent concurrency support
- The mathematical visualization community for inspiration