Created
May 1, 2015 23:42
-
-
Save NickDiMucci/7e24eb175245d418c975 to your computer and use it in GitHub Desktop.
Pseudo-code for obtaining the minimum and maximum positions of objects in a 2D space.
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
List xPositions; | |
List yPositions; | |
foreach target { | |
xPositions.Add(target.x); | |
yPositions.Add(target.y); | |
} | |
maxX = Max(xPositions); | |
maxY = Max(yPositions); | |
minX = Min(xPositions); | |
minY = Min(yPositions); | |
minPosition = Vector2(minX, minY) | |
maxPosition = Vector2(minX, minY) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment