By simply setting several parameters, You'll get a fancy magic curve immediately.
By setting eight parameters, WJMagicCurveView will draw a beautiful curve based on a math function.
First, we'll create two points and make them rotate in specified speed and specified radius revolving a same center; Second, whenever they reach a point during rotating, we'll draw a line connecting these two points; Thirds, continue rotate and draw lines, Bingo! You're creating a new beautiful curve!
We provide eight base parameters for normal users and more for developers from code level. Here are explaintion for these parameters:
- radiusAX、radiusAY: A point is the outer rotating point, these two are the radius of A;
- radiusBX、radiusBY: B point is the inner rotating point;
- speedOuterPoint、speedInnerPoint: the rotating speed for A & B;
- loopTotalCount: the loop count for these two rotating points;
- durationSeconds: the durationg speed for rotating.
Download it here and make a try!