Skip to main content

A package to calculate and visualize light interactions with water droplets.

Project description

Refractulator

Refractulator is a Python package that calculates and visualizes how light interacts with water droplets (or any medium given the appropriate refraction data).

Installation

pip install refractulator

To install with visualization support:

pip install refractulator[visualization]

What's New in Version 0.2.0

  • Visualization Module: Added support for 2D and 3D visualizations using Plotly.
  • Data Generator Class: Simplified data generation with the new RefractulatorDataGenerator class.
  • Examples: See the examples/ directory for usage examples.

Usage

from refractulator import Refractulator
import numpy as np

# Initialize Refractulator
refr = Refractulator(radius=1.0)

# Define incoming direction
D = np.array([1.0, 0.0, 0.0])

# Generate ray origins (example)
ray_origins = np.random.uniform(-0.5, 0.5, size=(100, 3))

# Calculate rays
rays = refr.calculate_rays_cylinder(ray_origins, D)

# Print the number of rays calculated
print(f"Number of rays calculated: {len(rays)}")

Features

  • Calculate refracted and reflected rays interacting with a spherical medium.
  • Support for multiple colors with different refractive indices.
  • (Optional) Visualization tools for ray paths.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Copyright (c) 2024 Scott Kilgore

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

refractulator-0.2.0b2.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

refractulator-0.2.0b2-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file refractulator-0.2.0b2.tar.gz.

File metadata

  • Download URL: refractulator-0.2.0b2.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.1

File hashes

Hashes for refractulator-0.2.0b2.tar.gz
Algorithm Hash digest
SHA256 2cbd935840430a3c6f29d03a05f645724a85b98eebcac75acca9b70ae4226a2e
MD5 c29cb0eef7a5a66dfe3591faf83c2eaf
BLAKE2b-256 2eb608fe6e7ede317aa1e38f5f97903623c245c7ce1a2fd9ba3c3d8e05081037

See more details on using hashes here.

File details

Details for the file refractulator-0.2.0b2-py3-none-any.whl.

File metadata

File hashes

Hashes for refractulator-0.2.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 dc8b338db82aa0f1892380b453d37030679a2a5648317c01823d15005a0925a0
MD5 23853cbc315b153c8e3bd921a42e924d
BLAKE2b-256 19268f65adfcc8822c84c2e9f47fb52fbc4623f2aa45fa0c6610768abccabb8c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page