Skip to main content

This package provides 2D vector and rectangle classes. These classes were written to be used in games, so they have some methods that conveniently tie into pyglet and pygame, but for the most part they are quite general and could be used for almost anything.

https://img.shields.io/pypi/v/vecrec.svg https://img.shields.io/pypi/pyversions/vecrec.svg https://img.shields.io/travis/kxgames/vecrec.svg https://img.shields.io/coveralls/kxgames/vecrec.svg https://readthedocs.org/projects/vecrec/badge/?version=latest

Installation

The vecrec module is pure-python, dependency-free, and available from PyPI:

$ pip install vecrec

Basic Usage

Here are a few examples showing how to construct and use the Vector and Rect classes provided by this package:

>>> from vecrec import Vector, Rect
>>> a = Vector(1, 2)
>>> b = Vector(3, 4)
>>> a + b
Vector(4, 6)

Rectangles are more commonly constructed using factory methods:

>>> Rect.from_size(8, 11)
Rect(0, 0, 8, 11)
>>> Rect.from_center(a, 1, 1)
Rect(0, 1, 1, 1)

Release files for vecrec 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vecrec 0.3.1
File Size Uploaded
vecrec-0.3.1.tar.gz 18.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vecrec 0.3.1
File Interpreter ABI Platform
vecrec-0.3.1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size:30.0 kB

Release files / vecrec-0.3.1.tar.gz

Download URL vecrec-0.3.1.tar.gz
Size 18.9 kB
Tags Source
SHA-256 checksum
How to use checksums
96ff0f833f5ab548f08e720b99998d3a86ac8ce4ba50ae9aa35936d3338cf97f
BLAKE2b-256 checksum
How to use checksums
336b30a71d137a7b39e2295e5b4dc858e177437bc5bdc1d04ab2c604ba63b6dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.25.1

Release files / vecrec-0.3.1-py2.py3-none-any.whl

Download URL vecrec-0.3.1-py2.py3-none-any.whl
Size 11.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
9d4725d304e6c696c84f1503c47d0c1a5a957f25cdaa8c8724d8d739c11136a2
BLAKE2b-256 checksum
How to use checksums
305f2270eac805b788674704ed30b3b0f6e036b71744ff498e7878ce636c1eb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.25.1

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page