Skip to main content

A linear algebra package written in Python

Project description

Linflex

A linear algebra package written in Python

Installation

Install using either pip or rye:

pip install linflex
rye install linflex

Getting started

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

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

linflex-0.2.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

linflex-0.2.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file linflex-0.2.0.tar.gz.

File metadata

  • Download URL: linflex-0.2.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for linflex-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c3fce5441aefda28df9a035cdd31865e0eaa0e83330a703f295881d772dbd368
MD5 ffca555ad315a3b7c572b8a4e216681b
BLAKE2b-256 43677e22defb211a788903bf3f1f418b2494d4471407334fbd9597c2a6be6286

See more details on using hashes here.

File details

Details for the file linflex-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: linflex-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for linflex-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a2bab73abf9c409eb4a7aa55641adf2713cb3e686bd336ab7984f1606cd7d048
MD5 2b1fece1664f7d17dc207c2015273505
BLAKE2b-256 8e715514f250fdcfe2c368cd884048fae10476e249997d53f3120f293f6fa33e

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