Last active
April 24, 2018 21:44
-
-
Save BlogBlocks/c8393c8ecc04665cccc79f1357efd2f9 to your computer and use it in GitHub Desktop.
largest center square of image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
w= 1000;h=500 | |
x=0;xy=0;y=w;yx=h | |
sf= abs((w-h)/2) | |
if w>h:x=x+sf | |
if w>h:y=w-sf | |
if w<h:xy=sf | |
if w <h:yx=h-sf | |
print (sf) | |
print (x, xy, y, yx) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment