Skip to main content

Allows you to draw beautiful matrices.

Project description

Drawing on a matrix

What is this?

The module allows you to create a symbolic matrix and draw different lines on it, after which you can convert the drawn lines into a beautiful structure.

Quick Guide

Drawing a simple, beautiful line:

my_picture = РЎanvas_matrix(10,10)
my_picture.makeline(1, 1, 8, 9)
my_picture.beautify()
my_picture.pt()

Using

Using the library is as simple and convenient as possible:

Let's import it first: First, import everything from the library (use the from ... import * construct).

To start working with the module, you need to create an object with the class Canvas_matrix, in this case we are creating a 10 by 10 matrix filled with spaces:

my_picture = РЎanvas_matrix(10,10," ")

This class has several methods that will help you master this library:

.pt() - prints the entire matrix, if pt = True, the garden will be printed after printing for the next print:

my_picture.pt(pt = False)

.makeline(x1, y1, x2, y2) - draws a line at two points, the coordinates start at 1, that is, the coordinate at the upper left point will be [0,0]

my_picture.makeline(1, 1, 8, 9)

.point(x, y, r) - draws a point in x, y coordinates with the same width and height r:

my_picture.point(5, 7, 2)

.local_draw - stores the coordinates of the local drawing, you no longer need to count the coordinates from the origin, but only from the beginning of the local coordinates:

my_picture.local_draw = [x, y]

.beautify() - Transforms a boring picture from identical symbols into a beautiful picture with different symbols:

my_picture.beautify()

an example of drawing a simple picture:

t = РЎanvas_matrix(10,25)
t.local_draw = [7,0]
t.makeline(0, 0, 4, 2)
t.makeline(20, 2)
t.makeline(25, -1)
t.local_draw = [2,4]
t.point(0,0)
t.point(10,-1)
t.beautify()
t.pt(False)

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

drawmatrix-0.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file drawmatrix-0.1-py3-none-any.whl.

File metadata

  • Download URL: drawmatrix-0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.3

File hashes

Hashes for drawmatrix-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 335a28188ae1dc9d2b5620f17522220f60ddd30b8ddaa093dad89c0125a47e87
MD5 edf4699e4012da190401c090b6f50d27
BLAKE2b-256 d5c10ec807f4123904e0a33a95d47f02a82787c8b8b612302e72e664f2323bc6

See more details on using hashes here.

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