Skip to main content

Fast CPython library for Vectors

Project description

rivector - risknu vectors

This Python library introduces a set of fast vector classes, designed for convenient and rapid vector operations, similar to those in Unity. It is well-suited for game development using Pygame and also useful for general mathematical applications. The library is open source and available on GitHub.

[!NOTE] It's worth noting that while you can add your own methods to the module, the library may not be as stable as other vector libraries. Please exercise caution and consider testing thoroughly, especially when compared to more established alternatives.

How it Works and Why It's Fast

The core mathematical logic and vector class are entirely written in C++. They are then utilized through CPython in Python, transforming it into a wrapper class that can be fully utilized in Python. Speaking of its power, here are some speed-related details, including a comparison with the popular numpy library in mathematics:

figure 1

+ Vector2Wrapper 0.8779744120547548
- NumPy 1.6510654900339432

Installation and Examples

To install this library on Python, you need Python version 3.12 or higher. Here are installation examples for different operating systems:

Windows

$ pip install rivector

Linux/MacOS

$ pip3 install rivector

Usage Examples and Creating a Simple Vector:

from rivector import Vector2

vector = Vector2(10, 10)

print(vector.magnitude)  # Magnitude of the vector
print(vector + 10)  # Vector(20, 20)
print(vector + vector)  # Vector(20, 20)
# Other operations...

[!NOTE] The library allows you to create and manipulate 2D vectors easily. You can find more details and methods in the wiki or in official website.

Feel free to contribute and enhance the functionality of the library as needed.

License

This library is distributed under the Apache License 2.0.

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

rivector-2023.1.17.1.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

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

rivector-2023.1.17.1-cp312-cp312-macosx_10_9_universal2.whl (17.9 kB view details)

Uploaded CPython 3.12macOS 10.9+ universal2 (ARM64, x86-64)

File details

Details for the file rivector-2023.1.17.1.tar.gz.

File metadata

  • Download URL: rivector-2023.1.17.1.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for rivector-2023.1.17.1.tar.gz
Algorithm Hash digest
SHA256 3bb195ccf00f3ce9ea606fb6aef09cca370354ba914202ec9315513e392f57f3
MD5 88514f2d067d162c697dc538e9991d8c
BLAKE2b-256 11fc8f2dc00b2e4140f873bc66b90234179593151daae8f89df8f2cf7b1acd27

See more details on using hashes here.

File details

Details for the file rivector-2023.1.17.1-cp312-cp312-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for rivector-2023.1.17.1-cp312-cp312-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 3eb2c07c6336c0d2aa16556c4c2c67baa791b8abffffd11d03cb1fb3a5e103d7
MD5 e953c41d008c7fa1da1b01b883ffc35e
BLAKE2b-256 3ff7c39a32c214b602fcae3e78767727bdb9b61c8fad66d2df54051677e836ea

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