Metadata-Version: 2.3
Name: linflex
Version: 0.2.2
Summary: A linear algebra package written in Python
Project-URL: Source, https://github.com/havsalt/linflex.git
Author-email: Havsalt <77575424+Havsalt@users.noreply.github.com>
License: MIT License
        
        Copyright (c) 2025 Havsalt
        
        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.
Requires-Python: >=3.10
Requires-Dist: typing-extensions>=4.4.0
Description-Content-Type: text/markdown

# Linflex

A linear algebra package written in Python

## Installation

Install using either `pip` or `rye`:

```bash
pip install linflex
```

```bash
rye add linflex
```

## Getting started

```python
from linflex import Vec2

a = Vec2(3, 4)
b = Vec2(2, -1)

assert a + b == Vec2(5, 3)
assert a - b == Vec2(1, 5)
assert a.length() == 5
assert -Vec2(2, -3) == Vec2(-2, 3)

c = Vec2(1, 1)
c += Vec2(0, 1)
assert c == Vec2(1, 2)
```

## Rational

`linflex` was created to fill the need for a common `Vec2` class accross my projects and packages. It is lightweight, as it only depends on `typing-extensions`. Aside from linear algebra, I also needed helper functions like `lerp`, `sign` and `clamp`, which was put into good use by `<Vec2>.lerp`, and alike.

## Includes

- Functions
  - `lerp`
  - `sign`
  - `clamp`
- Datastructures
  - `Vec2`
  - `Vec2i`
  - `Vec3`

## License

MIT
