command-line app for finding multipliers of square roots
Project description
△
A way to rationalize a square root to a whole number. make your square root whole.
This project is intended to be used as a simple calculator for bruteforcing and displaying different variations of irrational square-roots. I quickly built this for myself in a couple hours to fix an issue with my design work. By using this app I found a strong candidate for the side lengths of my hexagon's broken down model. When splayed out into triangles and squares each side length could be approximately represented in whole numbers.
| Example from game: Reassembly Unable to connect the two parts on the right together; the structure loses overall stability |
Example from Roblox studio: making a hexagon with walls results in stubborn seams which can be mitigated by choosing a better scale |
The Problem
A simple issue may be encountered when arranging equally sized squares onto triangle faces. They will not align back onto the standard grid ever again. Image above shows a case where an attempt is made to align the squares back with the grid using another 45 degree right triangle.
Getting The Solution
The previous example can be broken down into a function that solves for the marked distance:
$y=\frac{3}{2}\cdot x\sqrt{2}-\ 2\cdot x$
where x is the width of a square.
Substituting x with 58 (which I hand picked from a list my app generated), we can simplify $58\sqrt{2}$ into 82 because the real result is only two
hundredths of a unit away:
$y=\frac{3}{2}\cdot82-\ 2\cdot58$
the equation then quietly resolves to 7
applying the solution
Finally, we can fill the gap left by the odd geometry with a rectangle that's exactly 65 units in length.
Installation
- Install Python 3.14
- Download and extract the repository into a folder
- Run
run.cmd,run advanced.cmd, orrationalize_sqrt.pythrough a CLI
Command-Line Arguments (WIP)
| Flag | Description |
|---|---|
--version |
Show app version |
--help |
Shows argument list |
--advanced |
Runs app with extra options |
--checkupdate |
Check for available updates from GitHub |
--no_log |
Only show best output |
--save_results |
Save results to file |
--save_folder |
Set result save folder |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rationalize_sqrt-0.7.1.tar.gz.
File metadata
- Download URL: rationalize_sqrt-0.7.1.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c32491b721575d391798d8dc637a8c91c272b8b461aa53ad9efe86452e0833d
|
|
| MD5 |
af05eb012449d3e421424d4cbea35a1f
|
|
| BLAKE2b-256 |
425dc0bb72faa948bfccef2b4d111b6bdf2783791cc1781560ba47d11af698f8
|
Provenance
The following attestation bundles were made for rationalize_sqrt-0.7.1.tar.gz:
Publisher:
workflow.yaml on K1CE/Square-Root_rationalizer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rationalize_sqrt-0.7.1.tar.gz -
Subject digest:
2c32491b721575d391798d8dc637a8c91c272b8b461aa53ad9efe86452e0833d - Sigstore transparency entry: 760709027
- Sigstore integration time:
-
Permalink:
K1CE/Square-Root_rationalizer@4f9f365ab22c78ffa96d27ee9300f4b5dfbef722 -
Branch / Tag:
refs/tags/0.7.1 - Owner: https://github.com/K1CE
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yaml@4f9f365ab22c78ffa96d27ee9300f4b5dfbef722 -
Trigger Event:
push
-
Statement type:
File details
Details for the file rationalize_sqrt-0.7.1-py3-none-any.whl.
File metadata
- Download URL: rationalize_sqrt-0.7.1-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1c4d829c424dbc0e1e99c3adba2accf32c941f1f377f7779d3e71d55d7c9d38
|
|
| MD5 |
0375b8d1fba6609cbc28e6f40a3a5223
|
|
| BLAKE2b-256 |
0e6c615a427f92368b613d724de5c665c9ed823a6b303003a0a971e55ef93b65
|
Provenance
The following attestation bundles were made for rationalize_sqrt-0.7.1-py3-none-any.whl:
Publisher:
workflow.yaml on K1CE/Square-Root_rationalizer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rationalize_sqrt-0.7.1-py3-none-any.whl -
Subject digest:
a1c4d829c424dbc0e1e99c3adba2accf32c941f1f377f7779d3e71d55d7c9d38 - Sigstore transparency entry: 760709034
- Sigstore integration time:
-
Permalink:
K1CE/Square-Root_rationalizer@4f9f365ab22c78ffa96d27ee9300f4b5dfbef722 -
Branch / Tag:
refs/tags/0.7.1 - Owner: https://github.com/K1CE
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yaml@4f9f365ab22c78ffa96d27ee9300f4b5dfbef722 -
Trigger Event:
push
-
Statement type: