Example banana

Figure 66 and the following code show how to combine ellipses to create the shape of a banana.


    1  TGArea banana( TGEllipse( TGRect( 0, 48, 192, 240 ) ) );
    2  banana = TGEllipse( TGRect( 32, 0, 224, 288 ) );
    3  banana *= TGRect( 0, 64, 64, 216 );
    4  TGArea end( TGEllipse( TGRect( 16, 48, 56, 104 ) ) );
    5  end.TransformBy( TGrafMatrix( 38, TGPoint( 56, 48 ) ) );
    6  banana = end;
Line 1: Left side of banana.

Line 2: Right side of banana.

Line 3: Chop off the ends.

Lines 4: through 6: Fix the stem.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker