简体   繁体   中英

How to calculate the angle at which 2 slopes cross in excel

I want to calculate the angle at which two lines are crossing, where the angle should be expressed as a positive when green1 < blue1 and green2 > blue1.

Does anyone know how to do this in excel?

Period  Green   Blue
   1   210.99   212.99
   2   212.63   211.32

在此处输入图片说明

The formula you have calculates the angle between the slope and x-axis for a single line. You actually need to calculate the angle for both slopes and then take the difference between them. Since you want Green > Blue to be positive, you need to subtract the Slope of Blue from the Slope of Green.

That said, slope really requires defined values on the x-axis. You've only got values on the y-axis, which gives no bearing for the changes in y-axis. If you have values for the x-axis (representing changes in time or position or anything for the different values of green and blue) you should put those in your table. You should then plot the points using a scatter chart to input x and y values, and then format the table so that the 1 unit on each axis is the same length in the table.

In your example, for lack of an axis and just using the difference between x-values as 1, you just need:

=DEGREES(ATAN(change of green))) - DEGREES(ATAN(change of blue))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM