Use fillArc to Draw Yin and Yang

From Progzoo
Jump to navigation Jump to search
Flag of South Korea

This page shows you step by step how to draw the Yin-Yang device in the flag of South Korea.

...

Draw two semi-circles

Two Semi-Circles

  • The circle has radius 50

The method fillArc takes 6 parameters g.fillArc(x,y,w,h,start,subtend)

  • x and y are the coordinates of the containing rectangle
  • w and h are the width and height of the containing rectangle
  • start is the angle (in degrees) of the start of the arc. This is measured anti-clockwise from the 3 O'Clock position
  • subtend is the angle of the arc - measured anti-clockwise

You use Java to calculate the values required.

  • The centre of the flag has x-coordinate w/2
    • The containing rectangle is r to the left of this so you subtract r.
  • The square that contains the circle radius r has x coordinate w/2-r



[Font] [Default] [Show] [Resize] [History] [Profile]

Draw smaller semi-circles

Yin Yang

  • The circle has radius r=50
  • The small semi-circles have radius r/2

You use Java to calculate the values required.

  • The right semi-circle is in a rectangle at (w/2,h/2-r/2)
  • The size of the rectangle is r by r



[Font] [Default] [Show] [Resize] [History] [Profile]