Skip to main content

Vectors on an isometric grid.

Project description

Overview

Geometry on an isometric grid.

Installation

To install isometric, you can use pip. Open your terminal and run:

pip install isometric

Usage

import isometric as iso

d = iso.Description(x = 2, y = -3, z = 7)
print(d) # Description(x=2, y=-3, z=7)
print(d.tare_x()) # Description(x=0, y=-5, z=5)
print(d.tare_y()) # Description(x=5, y=0, z=10)
print(d.tare_z()) # Description(x=-5, y=-10, z=0)
print(d.projected_abscissa()) # -4.330127018922193
print(d.projected_ordinate()) # 7.5
print(d.projected_radius()) # 8.660254037844387
print(d.projected_angle()) # 2.0943951023931953

v = iso.Vector(x = 2, y = -3, z = 7)
print(v == iso.Vector(*d)) # True
print(v) # Vector(projected_abscissa=-4.330127018922193, projected_ordinate=7.5)
print(v.tare_x()) # Description(x=0, y=-5, z=5)
print(v.projected_abscissa()) # -4.330127018922193
print(v.rotate(1)) # Vector(projected_abscissa=4.330127018922193, projected_ordinate=7.5)
print(v.rotate(1).tare_x()) # Description(x=0, y=5, z=10)
print(v * -3) # Vector(projected_abscissa=12.990381056766578, projected_ordinate=-22.5)
print(v ** 2) # 75.0
print(v ** 3) # Vector(projected_abscissa=-324.7595264191645, projected_ordinate=562.5)

w = iso.Vector(1, 1, 0)
print(v + w) # Vector(projected_abscissa=-4.330127018922193, projected_ordinate=6.5)
print(v * w) # -7.5

In the isometric plane the x-axis points at 8 o’clock, the y-axis point at 4 o’clock and the z-axis points at 12 o’clock.

License

This project is licensed under the MIT License.

Credits

Thank you for using isometric!

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

isometric-1.0.7.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

isometric-1.0.7-py3-none-any.whl (4.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page