//------------------------------ rightCurve --------------------------------- // draw a level-l right curve with dist d void Sierpinski::rightCurve( int level, float d ) { if ( level > 0 ) { leftCurve(level-1, d); turn(-60); rightCurve(level-1,d); turn(-60); leftCurve(level-1,d); } else draw( d ); }
//------------------------------ rightCurve --------------------------------- // draw a level-k right curve with dist d void Dragon::rightCurve( int level, float d ) { if ( level > 0 ) { turn(-90); leftCurve(level-1, d); turn(-90); rightCurve(level-1, d); } else draw( d ); }
//------------------------------ rightCurve --------------------------------- // draw a level-l right curve with dist d void Gosper::rightCurve(int level, float d) { if (level > 0) { turn(-60); leftCurve(level - 1, d); turn(60); rightCurve(level - 1, d); rightCurve(level - 1, d); turn(120); rightCurve(level - 1, d); turn(60); leftCurve(level - 1, d); turn(-120); leftCurve(level - 1, d); turn(-60); rightCurve(level - 1, d); } else { draw(d); //Recursion Base } }