Skip to content

Converting circle coordinates to a transformed square coordinate from that circle, sharing a radius.

Notifications You must be signed in to change notification settings

katzerax/circletosquare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

circletosquare

This program converts a set of circle coordinates (coordinates underneath the line of a circle with a given radius), into a transformed set of coordinates based on a square with the same diameter (in the shown example with a radius of 256; -256 <= x <= 256, -256 <= y <= 256).

image

into

image

But, I wanted it to not just work at the edges, and to transform any coordinate according to the transformation of the circle into the square. So, for example:

image

Etc. The purpose of this was to see how I would convert a joystick which has the wrong maximum inputs, as a circle, and map them onto correct maximum inputs, as a square. The actual file only has a radius of 1, as that matches with windows' measurement of a controller's input.

About

Converting circle coordinates to a transformed square coordinate from that circle, sharing a radius.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages