cancel
Showing results for
Did you mean:
Announcement | We’re thrilled to announce our newest Alteryx Designer Expert Certified users! Learn more.
Do you have the skills to make it to the top? Subscribe to our weekly challenges. Try your best to solve the problem, share your solution, and see how others tackled the same problem. We share our answer too.
Weekly Challenge
Do you have the skills to make it to the top? Subscribe to our weekly challenges. Try your best to solve the problem, share your solution, and see how others tackled the same problem. We share our answer too.
Unable to display your progress at this time. Please try again a little later, or contact an administrator if you continue to see this error.

## Challenge #67: Calculate Spatial Angles

Bolide

Solution attached.

Highlighted
Alteryx Partner
Spoiler
Asteroid

Challenge Completed

Asteroid

My solution :)

Alteryx Partner

Just realized there was a "bonus" part of the question. Will come back to it later.

Spoiler
Alteryx Certified Partner

Follow my solution attached...

Asteroid

I solved this using the spatial tools (and a crowbar!) a couple of weeks ago but I left the non-spatial aspect of the challenge to come back to when I'd had more experience with Alteryx.

I now see my initial solution was needlessly over-complicated so I figured out a better way to do it, as well as solved the non-spatial tool method. I enjoyed working with the spatial expressions!

I left in my first pop at this challenge for everyone's amusement.

Spoiler

Bolide

After much too much frustration over trigonometry and not remembering things, I finally figured it out. Moments after, I remembered the spatial tool that could so easily do this for me! So here are both ways.

Spoiler
Bolide

Ha! Trig.  And high school was so very, very long ago!

Spoiler

Dan

Meteor

Spoiler

My workflow:

Illustrative:

Please ignore the unnecessarily complex workaround I used to build point C in spatial tools, and the fact that I did not consider the situation when point A may not be the vertex. My two questions are:
1. In the "without spatial tools" part I extracted the coordinates as Double fields and calculate the length of AC and BC with ST_Length and CreatePoints. Then I used ArcTan(BC/AC) to determine Angle A, which turned out to be slightly different from the output from spatial tools (31.592 instead of 31.607). Could anyone tell me why and how to fix it?
(My assumption is the loss of accuracy when I try to put the coordinates in a Double field)

2. Initially I tried to calculate AC and BC by subtracting coordinates (i.e. Length of AC=Abs([X coordinate of A]-[X coordinate of B]) and naturally got the wrong results, which led me to the question: what are these coordinates used in building spatial objects? Are they longitudes and latitudes, and the positive/negative numbers tell West vs East, and North vs South? Is my assumption correct?

I have finished this but have two questions, could someone kindly provide some pointers here? Thanks!

(Please see inside spoiler)