Challenge #161: Triangles, Triangles, Triangles
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Fun challenge! Last filter needed to match solution, but shouldn't tiny triangles still count? Investigation of original data indicates these are non-linear points (Thank you Mr. Coss - High School Geometry Teacher)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I'm delighted that I could contribute to the awesome-ness that is the Weekly Challenges! I originally designed this with several sub-challenges if you want more:
- Draw a triangle using Spatial tools
- Draw a triangle without using Spatial tools
- Draw multiple triangles using only a single tool
- Draw multiple triangles using an iterative macro
- Draw all 516 unique triangles
A note on the "valid" solutions: due to how the points were drawn, it is possible to produce some very thin triangles that would be collinear if a grid was drawn on a Cartesian plane. Rather than adjusting the points, I was curious to see different approaches to handing these scenarios.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Challenge #161, done.
I also removed the tiny triangles to get to the final answer - (unsure why they don't count)
Cheers,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Fun challenge! I had to look up (as I couldn't remember back to high school trigonometry how to determine if 3 points were collinear.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Interesting. Final filter was a challenge
First tried to filter triangles using ST_DIMENSION (should return 1 for lines)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
OK so I got a bit hung up on the definition of "Non-Collinear", so my workflow actually has 2 solutions - one that gets 516 unique triangles (not the most efficient solution compared to others, but logically it got me there, and I feel like my high school math teacher wouldn't have been mortified, so I'm okay with it)... and then an alternate solution that I feel better matches the intention that all triangles be "non-collinear", which I defined to mean that there could be no point in the triangle that was at the same latitude or longitude plane as any other point in that triangle. Results in far fewer triangles (essentially, any triangle with a straight vertical or horizontal side is eliminated by this method).
Either way, super fun challenge @CharlieS!
Method #2: Create only triangles that do contain any points that are on the same plane (latitude or longitude). Again, a bit of a roundabout way to get there (once again finding an obscure reason to use one of my hidden favorite tools, Make Columns!)... but conceptually this one was actually easier for me to wrap my head around. And since I cheated a little by borrowing the Unique tool from other solutions as my method to get rid of duplicates, I opted to not use any Spatial tools for this method, using the Spatial formulas instead. BONUS: The resulting picture of triangles with this method is quite pretty! :)
Cheers,
NJ