Skip to main content

A pixel rotation module

Project description

SC ENGINE

SC-Engine is a rotation engine coded by @SplatCraft

It works with Oz-Engine (or other libraries)

SETUP

In shell, type the following command :

pip install SC-Engine

In your file, write this:

import SC

USE

POINT ROTATION

Let's try to rotate a point around another point !

new = SC.rotate_pixel([1, 1], [3, 3], 180)

# here we are rotating the point at x=1 y=1 around the point at x=3 y=3 to 180 degrees

# this function returns a list of two integers [x,y]

print(new)

Run the project and see what happens

[5, 5]

And those are the new coordinates of the point !

SHAPE ROTATION

sh = [
  ["#","#","#"],
  ["#"," "," "],
  ["#","#","#"]
]

new = SC.rotate_shape(sh, [5,5], [4,6], 90)

# sh  is the shape to rotate
# [5,5]  are the coordinates of the bottom_right corner of the shape
# [4,6]  are the coordinates of the point to rotate the shape around
# 90 is the angle of rotation

print(new)

And it returns this :

[[["#","#","#"],
  ["#"," ","#"],
  ["#"," ","#"]],
 [3,6]]

We can see that there is the rotated shape, and the new bottom right coordinates of the shape

GET CORNER POINT

With this function we want to get the coordinates of a corner of a shape

new = SC.get_corner(sh, [5,5], SC.bottom_right, SC.top_right)

print(new)

And here is the result :

[5,7]

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

SC-Engine-1.0.7.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

SC_Engine-1.0.7-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file SC-Engine-1.0.7.tar.gz.

File metadata

  • Download URL: SC-Engine-1.0.7.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for SC-Engine-1.0.7.tar.gz
Algorithm Hash digest
SHA256 b81877dd59ceed6adcbe098708e8d940704838b30859d1b1f2593baa026f429c
MD5 7e09167b1f21b80d496a24a1ffd3a6af
BLAKE2b-256 ba178144e8bc73592be0e71b2d5c678fd45d335070096ca75a60bd27883b7e96

See more details on using hashes here.

File details

Details for the file SC_Engine-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: SC_Engine-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for SC_Engine-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 82cda06e3efb862d7d70fd0f533baf1ea1f425e239bc79344a37dffd7374950d
MD5 e0d6ecc4c97c680f2436c8b4d8144d81
BLAKE2b-256 3617594c3e8b0028dec923646a8470f40117b3fa1da7e00fc9854335018134b6

See more details on using hashes here.

Supported by

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