Skip to main content

Cvectors

Cvectors is a Python package for 2D vectors. It provides a class, Vector, which uses complex internally.

Usage is as follows:

>>> from cvectors import Vector
>>> foo = Vector(4, 3)
>>> foo
Vector(4.0, 3.0)
>>> foo.x
4.0
>>> foo.y
3.0
>>> foo.r
5.0
>>> bar = Vector(4, 5)
>>> foo + bar
Vector(8.0, 8.0)
>>> foo.dot(bar)
31.0
>>> import math
>>> foo.rotate(math.pi / 2)
Vector(-2.9999999999999996, 4.0)
>>> Vector.from_polar(r=3, theta=5) - Vector.from_polar(r=5, theta=2)
Vector(2.9317207391253906, -7.423259958117824)
>>> Vector(5, 6).perp_dot(Vector(-6, 1))
41.0
>>> abs(foo)
5.0
>>> Vector(1, -9).rec()
(1.0, -9.0)
>>> Vector(1, -9).pol()
(9.055385138137417, -1.460139105621001)
>>> Vector(3, 2).perp()
Vector(-2.0, 3.0)
>>> Vector(3.142, 2.718).round()
(3, 3)
>>> Vector(3.142, 2.718).round(1)
(3.1, 2.7)

Metadata

Release files for cvectors 9.1.2

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

Source distribution (sdist)

Source distribution for cvectors 9.1.2
File Size Uploaded Provenance Actions
cvectors-9.1.2.tar.gz 18.6 kB Without provenance Details for cvectors-9.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cvectors 9.1.2
File Interpreter ABI Platform Actions
cvectors-9.1.2-py3-none-any.whl Python 3 none any Details for cvectors-9.1.2-py3-none-any.whl

Total release size: 34.1 kB

Release files / cvectors-9.1.2.tar.gz

Download URL cvectors-9.1.2.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d7ddbd0294b704b32ead7a4e37c5071065f90e214aafc2c3868d5f365ed1dc09
BLAKE2b-256 checksum
How to use checksums
dd267701949d33d29014ac24ecb4d980947ed82e25e24999c5c582e9dfa9287f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.3

Release files / cvectors-9.1.2-py3-none-any.whl

Download URL cvectors-9.1.2-py3-none-any.whl
Size 15.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a5e2f01d9bf6e334d4db7684228dd38b0f43d10f72bcec8fdcea2215f397f309
BLAKE2b-256 checksum
How to use checksums
f9135ad0b59174de6fa3ea1fdd80c03bd2edbb13a53475311a074aa3c0df9fef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.3

Security for cvectors 9.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

9.1.2 This release

2 release files No provenance

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