Created
April 13, 2017 13:45
-
-
Save sminogue/4400e46a614989a3fabe17c880a22397 to your computer and use it in GitHub Desktop.
This file contains 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
//Get the four corners and add them to a list fot sorting. | |
List<Point2D_F64> points = new ArrayList<>(); | |
points.add(polygon.get(2)); | |
points.add(polygon.get(1)); | |
points.add(polygon.get(0)); | |
points.add(polygon.get(3)); | |
//Sort the points so that the array is in TL, TR, BR, BL order | |
points = sortPoints(points); | |
//Pull the four points out into variables for ease of use | |
Point2D_F64 topLeft = points.get(0); | |
Point2D_F64 topRight = points.get(1); | |
Point2D_F64 bottomRight = points.get(2); | |
Point2D_F64 bottomLeft = points.get(3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment