iphone - draw infinite sine wave using UIBezier curve -
i have task draw sin wave user birthdate infinite using uibezier curve , create using below code :
for (int i= 0; i<=app.noofdaysdifference; i++) { [path1 addlinetopoint:cgpointmake(i*cwidth+100, 55-(sin(2*3.141592654*i/23))*cheight)]; [path2 addlinetopoint:cgpointmake(i*cwidth+100, 55-(sin(2*3.141592654*i/28))*cheight)]; [path3 addlinetopoint:cgpointmake(i*cwidth+100, 55-(sin(2*3.141592654*i/33))*cheight)]; } [path2 setlinewidth:2.5]; [path3 setlinewidth:2.5]; [path1 setlinewidth:2.5]; [[uicolor bluecolor] set]; [path1 stroke]; [[uicolor redcolor] set]; [path2 stroke]; [[uicolor greencolor] set]; [path3 stroke];
but take time draw due no of days. yes have 1 more idea should use queue technique draw first 200 point again 200 till no of days. suggest me logic take short time draw .
Comments
Post a Comment