excel - Angle of rotation for a data label along a line on a chart -
i have chart plots flow vs power. want adjust rotation of data label sits on top of line on chart match slope of line. first point plotted @ 25000, 87000; second point plotted @ 53000, 182000. if manually count gridlines , tangent(theta) = opposite / adj answer makes sense ~22º if use actual data graph angle wrong. eyeballing graph, looks 22º using plot data gives me 73º.
it seems confusing opposite , adj. 73º right answer these data.
you have 2 points p1 = (x1, y1)
, p2 = (x2, y2)
.
segment p1p2 has slope angle (in radians)
a = atan2(y2 - y1, x2 - x1)
(i don't know exactly, whether atan2
or arctan2
function exists in vba math library - a discussion found)
Comments
Post a Comment