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 add 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.1.tar.gz (8.8 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.1-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for linflex-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e44cdfae8c08dd114090434b301c666d665d35593dea1dc325e7be913273da7b
MD5 e3a1128ab7be1bac6d8a0478bfa35252
BLAKE2b-256 bc83b2c3a1761e8ac5bf6f3f662ea839b54aec26323cfe18c7f6da456f3e105f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for linflex-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cadca7bd007acf3b4132f0d8a48a841d05eb5f4be2abae40629292af8a3e32f1
MD5 ae865c7f29fc744691d10689993f8b61
BLAKE2b-256 7028c8fecbb707083d7ca523d90f33a994a3d7b0f3d36d72abe31f50f9a0b626

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