Given the line
LINESTRING(-9.086532643219698 -7.939337106873815,-1.396102955719698 -0.9775148048290135,-0.780868580719698 -0.7138718839794582,-0.077743580719698 -0.6699297767574899,0.581436106780302 -0.6699297767574899,1.372451731780302 -0.6699297767574899,1.987686106780302 -0.6699297767574899,2.690811106780302 -0.7578135712925369,3.218154856780302 -0.6699297767574899,0.801162669280302 1.1756755719445946,10.293350169280302 9.525132229415934)
Which look likes this (start point is bottom left):
What is the correct methodology to find the overall azimuth which based on visual inspection should be something like this red line:
At first glance I figured if I calculate the azimuth between every point pair and then average them it would get what I want (something like https://social.msdn.microsoft.com/Forums/officeocs/en-US/74cd7844-30fe-43d3-a45e-9733c83d09b3/vector-average-function-in-tsql?forum=transactsql )
Using this approach the average azimuth is ~72.22 when I would expect it to be around ~50 degrees.
I realized that it doesn't take into consideration the length (magnitude) of each line segment, and the 2 dominant segments (both ~45 degree azimuth) only accounts for 2/10 of the average (2 point pairs of the total 10 point pairs).
So it seems liked I need to use the length of each segment as a weight to the average.
That's when I thought maybe vector math (dot product) is whats needed because I have a magnitude (length) and angle (azimuth); However, because the segments (vectors) are already lined up head to tail, the resultant vector's angle would just be the angle between the start point and end point (which is not what I am after)
I am looking for approaches to mathematically solve this problem, or references to what it's called that I am after.