Metadata-Version: 2.4
Name: ezvectors
Version: 0.1.2
Summary: A lightweight, zero-dependency 2D vector library for Python.
Project-URL: Homepage, https://github.com/adyanthm/ezvectors
Project-URL: Documentation, https://github.com/adyanthm/ezvectors/blob/main/documentation.md
Author: Adyanth M
License: MIT License
        
        Copyright (c) 2026 Adyanth M
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE.md
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.7
Description-Content-Type: text/markdown

# ezvectors

A fast and lightweight 2D vector class for Python. No dependencies required.

I built this because I needed vectors for my initial prototype of a 2D [physics engine](https://github.com/adyanthm/physics) and using NumPy for some really simple vector math is genuinely slower than pure Python. The overhead of calling into compiled C code through Python's FFI for something as small as adding two floats together completely negates any performance benefit. So I wrote my own vector library!

`ezvectors` gives you a `Vector2` class that uses `__slots__` for a small memory footprint, avoids unnecessary object allocation in arithmetic, and works seamlessly with plain tuples.

You can install `ezvectors` via pip:

```bash
pip install ezvectors
```

## Usage

```python
from ezvectors import Vector2

a = Vector2(3, 4)
b = Vector2(1, 2)

a + b             # Vector2(4, 6)
a - (1, 1)        # Vector2(2, 3) — tuples work everywhere
a * 2             # Vector2(6, 8)
a.magnitude()     # 5.0
a.normalize()     # Vector2(0.6, 0.8)
a.dot(b)          # 11
a.distance_to(b)  # 2.8284...
a.rotate_deg(90)  # Vector2(-4, 3)
```

Full API reference and examples in [documentation.md](https://github.com/adyanthm/ezvectors/blob/main/documentation.md).

## Tests

```bash
pip install pytest
pytest tests/
```

## License

MIT — see [LICENSE.md](LICENSE.md).
