This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

2D vector and rectangle classes

Project Description

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.

Installation

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

$ pip install vecrec

Basic Usage

In lieu of complete API documentation, here are a few examples showing how to construct and use 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 History

Release History

This version
History Node

0.3.0

History Node

0.2.1

History Node

0.2.0

History Node

0.1.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
vecrec-0.3.0.tar.gz (118.9 kB) Copy SHA256 Checksum SHA256 Source Mar 16, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting