08-11-2005 07:53 AM
08-11-2005 09:03 AM
08-11-2005 09:23 AM
Hello peter,
i'm not sure that i got it right, but i think you want to compare the two curves at different offsets along the x-axes to find a optimal position or something like that. if you extract just the arrays of the y-values from your graphs you loose all information about the x - offset, because you allways compare value 1 of graph 1 with value 1 from graph 2, then value 2 from graph 1 with value 2 of graph 2 and so on, no matter where the graphs are located on the x-axes. thats the reason why you allways get the same difference.
i think you wan't to compare the values at H = 50, 51, 52.... of both graphs. to do that you first need to find the y - value of the graphs at the same value of H. see attachment (it's not tested, so don't blame me!!)..
btw.: if you use a while loop for polling buttons you always should call a wait function with ~ 10-100 ms inside the loop to avoid 100% CPU usage. a event structure would be much better, but's that's a task for the next project..
best regards & good luck
chris
08-11-2005 09:59 AM
HI!
Thank you for your solutions and tips!
I have found another solution for my problem, see the attachement!
Best regards,
PETER