Finding perpendicular line at on a curve given only three points

24 Views Asked by At

I am working on my thesis and I am out of my depth with the mathematical formula for defining the slope of a perpendicular line for a curve through three points. I do not know anything besides 3 XY coordinates and I need to find the angle at the middle point. This is just a small part of my thesis, but I've spent a bunch of days trying to find a simple solution and realised I should ask the smart people here instead of continuing to bang my head against the wall. Not a mathematician, just an engineer, so this stuff is going over my head.

The points are roughly equidistant by the X coordinate, and therefore I can't just readily average the angle between the two. I don't necessarily need a perfect result, and it is a calculation that I will need to run quite a few times a second on a potato, but I was wondering if the people on here would have any good methods for finding the tangent slope at the middle point.

The calculation needs to be accurate down to 1 degrees for the given points, should be as simple to run as possible.

Preferably, the angle should be expressed in terms of slope ΔX and ΔY per unit of hypotenuse, and it could work even if the points aren't equidistant.

Below is a table of points and correct angles that I made while I was trying to solve the problem in order to check whether it works.

Point 1 Point 2 Point 3 Correct Angle º
0 , 0 5 , 0.2532 10, 1.0207 -5.7976
5 , 0.2532 10, 1.0207 15 , 2.3276 -11.6557
10, 1.0207 15 , 2.3276 20 , 4.2205 -17.6406
15 , 2.3276 20 , 4.2205 25 , 6.775 -23.8323
20 , 4.2205 25 , 6.775 30 , 10.1274 -30.3364
25 , 6.775 30 , 10.1274 35 , 14.4975 -37.3074
30 , 10.1274 35 , 14.4975 40 , 20.3427 -45.0000
35 , 14.4975 40 , 20.3427 45 , 28.8819 -65.3864