Given a curve, I have to prove or disprove that it is a straight line. How do I do this?
I tried by finding and comparing slopes but I can see that this will not be a very computationally efficient way (as I am implementing this on a PC) ; I will have to find slopes at different points and see if the slope is changing or not. If the slop has not changed, I will chose next point and find the slope at this new point. And yes there are infinite points on the line, so how many slopes I am going to measure ?
Another trick I adopted is Divide and Conquer; I divided the entire curve into N segments, and processed each segment using multi-threading, looking for slope changes at several different places simultaneously. This also seem not very efficient, given the kind of curves I am processing. Even I have to look for inter-segment slope changes in addition to intra-segment slope changes
Any other computationally efficient way? Some of the curves that I am dealing with are as follows:
(As can be seen only one or two small curves look like straight lines. )
I want to understand an efficient algorithm from two different point of views:
1- When the equations for each curve is given; Algebra point of view
2- No equations are given, only images are given; may be I can call this Geometry point of view