Thursday, 15 April 2010

ios - How do you get interpolated data points in Core Plot? -



ios - How do you get interpolated data points in Core Plot? -

in core plot, user scrolls, trying move annotation along line of scatter plot. have info points @ each hour, plot annotation @ more hr marks. i'd cgpoint info interpolated data. instance, i'd cgpoint hr (index) 12.25.

i have been searching ways this, can't find one.

linear interpolation (wikipedia link) easy.

given 2 points, (x1, y1) , (x2, y2), point between them a fraction between 0 (0) , 1 (1), interpolated point (x, y) given by:

x = (1 - a) * x1 + * x2 y = (1 - a) * y1 + * y2

in illustration given in question, a 0.25.

ios objective-c core-plot

No comments:

Post a Comment