tags:

views:

95

answers:

0

I have using belo code for draw line between two points.

#define PI 3.14159

CGContextBeginPath(ctx);

int x;
for(int y=rect.origin.y; y < rect.size.height; y++)
{
    x = ((rect.size.width/4) * sin(((y*4) % 360) * PI/180)) + rect.size.width/2;

    if(y == 0)
    {
        CGContextMoveToPoint(ctx, x, y);
    }
    else
    {
        CGContextAddLineToPoint(ctx, x, y);
    }
}

CGContextStrokePath(ctx);

But i want to implement with animation.how it possible?can u help me?