# Weekly Challenge

Solve the challenge, share your solution and summit the ranks of our Community!
###### IDEAS WANTED

We're actively looking for ideas on how to improve Weekly Challenges and would love to hear what you think!

Submit Feedback
We've recently made an accessibility improvement to the community and therefore posts without any content are no longer allowed. Please use the spoiler feature or add a short message in the message body in order to submit your weekly challenge.

## Challenge #67: Calculate Spatial Angles

Highlighted
Alteryx Community Team

The solution to last week's challenge can be found HERE.

This week, we get back to spatial! A wireless carrier wants to geolocate or triangulate the location of a device/user based on the location of nearby cell towers and the device/user by determining the azimuth. As a result, they would like to calculate the angle (in degrees) between two points where a line is drawn from the lower point directly horizontally towards the other point.

Bonus: Try solving one way with the spatial tools, and another using no spatial tools!

Highlighted
14 - Magnetar

My solution, two ways - one with spatial tools, one without! 🙂

PS. Holy trigonometry, I had to dig deep for that one. My high school self is very disappointed with me right now for apparently forgetting everything I once knew about calculating angles...

Spoiler

Highlighted
11 - Bolide

I used a couple more tools than @NicoleJohnson to calculate all the distances and angles, but came away with the solution in both formats.  Another Masonic image transposed onto the DC landscape 😆

Spoiler
Highlighted
Alteryx Certified Partner

I got to the same answer as @NicoleJohnson, but stopped after getting the right result.  I get no dessert.

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Highlighted
7 - Meteor

Oh gosh my way is super hackish and I didnt know how to do the bonus. I've had a look and there are definitely a lot of spatial features I am not familiar with, especially the functions, nice to learn from other's answers.

Spoiler
Highlighted
16 - Nebula

So - full credit goes to this site which explained the full math of the great circle distance; provided pseudo code in Java / excel formulas; etc.   http://www.movable-type.co.uk/scripts/latlong.html

I fully admit I don't understand the derivation of these formulae, but at least a little smarter now on how to use some of the trig & distance functions in Alteryx

This solution contains both spatial & basic trig version, and the non-spatial calculates both distance and angle fully using trig.

To @NicoleJohnson 's point - who would have ever thought that a subject like "Math" would come in useful one day...

Possibly one-day, I may find a good use for some of the other subjects we did in school like accounting; computer science; Inglish Wrting; etc. 🙂

Spoiler

Highlighted
Alteryx Certified Partner

Hopefully, my spatial solution will count as spatial since I used only one spatial tool.

I also have to admit a trigonometry defeat as I am sure 16 formulas were unnecessary and the answer I got was anyway smaller by ~1,5 degrees. That being sad, my spacial answer is also a bit off but I guess it can be a rounding error.

Spoiler

Highlighted
Alteryx Community Team

The solution for Challenge #67 is posted! I'm sorry if is exacerbated any negative feelings around having to recall some highschool trig for that bonus. 🙂

Highlighted
Alteryx Certified Partner

Thanks, JoeM

I see many people use Spatial info before cross tab and distance calculation. Is there any reason for that, as I had the same results without this step?

Highlighted
14 - Magnetar

Haven't solved it without the spatial tools yet. Here's my solution with the spatial tools. Nothing very creative.