How to visualize a smooth path based on a set of data points?

I have been looking for ways over the past two days without a real solution.

By wrapping a path, I mean a given set of data points x, y (at different distances) to draw a dashed line (or in my case a quarter turned) of a fixed length at regular intervals between given data points to create a smooth path.

If you have flight control for the iPhone, I'm trying to create a similar effect to render the path in this game.

Here is my problem. If the width of the graphic image + the gap does not differ from the distance between the two points of the data set, I leave them with an overlap or underlayer. My only solution to this is either

1) Take the overlap / winged point as the end point of the next data point and then from there to the next point.

2) Always draw under the end endpoint and start with a new data point.

None of these solutions are perfect, and both have problems.

Does anyone have a better solution?

Any help would be greatly appreciated.

The following screen illustrates what I'm trying to create: http://www.firemint.com/flightcontrol/screenshots-peaceful.html

Thick dotted line.

Update:

, , ( 4 ). . 0 1, 2 . ( ). , , , , (, 0,2) . , , , ... , ?... ?

+5
4

CoreGraphics, CGPathAddQuadCurveToPoint, . , , GitHub.

+3
+1

, .

+1

? - .

, . , , , . , .

:

, . , iPhone , . , /, , . , , , , , .

:

  • ( )
  • , X .
  • Lerp , , .
  • ( )
  • 2
  • , ( , ).

, D, (, , 2D-, ):

vector v = point2 - point1;
normalize(v);
v *= D;
finalPoint = point1 + v;
0

All Articles