original_docstring: Create the static airfoil and flap dictionaries containing the outer
      mold coordinates of both. Because it is necessary to have an intersection
      between the static lower surface and the flap lower surface, it is
      sometimes interesting to have an extra poin in the static surface to 
      garantee the intersection.
      
      :param data: dictionary with x and y cooridnates of the whole outer mold
      
      :param hinge: dictionary with x and y coordinates of hinge. Can be found
                    via find_hinge.
                    
      :param extra_points: include extra points to surface, extending it more
                           than it will actually be (usefull for intersecting
                           lines). Avaialble options: 'lower', 'upper' and None
docstring: Create the static airfoil and flap dictionaries containing the outer
  mold coordinates of both. Because it is necessary to have an intersection
  between the static lower surface and the flap lower surface, it is
  sometimes interesting to have an extra poin in the static surface to
  garantee the intersection.
docstring_tokens: Create the static airfoil and flap dictionaries containing the outer mold coordinates of both . Because it is necessary to have an intersection between the static lower surface and the flap lower surface it is sometimes interesting to have an extra poin in the static surface to garantee the intersection .
code: def find_flap(data, hinge, extra_points = None):
      """Create the static airfoil and flap dictionaries containing the outer
      mold coordinates of both. Because it is necessary to have an intersection
      between the static lower surface and the flap lower surface, it is
      sometimes interesting to have an extra poin in the static surface to 
      garantee the intersection.
      
      :param data: dictionary with x and y cooridnates of the whole outer mold
      
      :param hinge: dictionary with x and y coordinates of hinge. Can be found
                    via find_hinge.
                    
      :param extra_points: include extra points to surface, extending it more
                           than it will actually be (usefull for intersecting
                           lines). Avaialble options: 'lower', 'upper' and None"""
      #Generate empty dictionaries which will store final data.
      flap_data = {'x':[], 'y':[]}
      static_data = {'x':[], 'y':[]}
      
      type = None
      
      for i in range(len(data['x'])):
          xi = data['x'][i]
          yi = data['y'][i]
      #Because of the way that xfoil works, the upper list will always
      #begin from the trailing edge    
          if xi > hinge['x']:
              if type == None:
                  type = 'upper'
              elif type == 'lower':
                  flap_data['x'].append(hinge['x'])
                  flap_data['y'].append(hinge['y_' + type])
                  static_data['x'].append(hinge['x'])
                  static_data['y'].append(hinge['y_' + type])
                  # this will make the at the hinge to be included only once
                  type = 'upper'
                  #If the extra point is unecessary in the lower
                  if extra_points == 'lower':
                      static_data['x'].append(data['x'][i+1])
                      static_data['y'].append(data['y'][i+1])
                      static_data['x'].append(data['x'][i+2])
                      static_data['y'].append(data['y'][i+2])
              flap_data['x'].append(xi)
              flap_data['y'].append(yi)
              
      #Because of the way that xfoil works, the lower list will always
      #begin from the  leading edge  
          else:
              if type == None:
                  type = 'lower'
              elif type == 'upper':
                  #If the extra point is unecessary in the upper
                  if extra_points == 'upper' and len(static_data['x']) == 0:
                      static_data['x'].append(data['x'][i-2])
                      static_data['y'].append(data['y'][i-2])
                      static_data['x'].append(data['x'][i-1])
                      static_data['y'].append(data['y'][i-1])
                  flap_data['x'].append(hinge['x'])
                  flap_data['y'].append(hinge['y_' + type])
                  static_data['x'].append(hinge['x'])
                  static_data['y'].append(hinge['y_' + type])
                  # this will make the at the hinge to be included only once
                  type = 'lower'
                  
              static_data['x'].append(xi)
              static_data['y'].append(yi)   
      return static_data, flap_data
code_tokens: def find_flap ( data , hinge , extra_points = None ) : flap_data = { 'x' : [ ] , 'y' : [ ] } static_data = { 'x' : [ ] , 'y' : [ ] } type = None for i in range ( len ( data [ 'x' ] ) ) : xi = data [ 'x' ] [ i ] yi = data [ 'y' ] [ i ] if xi > hinge [ 'x' ] : if type == None : type = 'upper' elif type == 'lower' : flap_data [ 'x' ] . append ( hinge [ 'x' ] ) flap_data [ 'y' ] . append ( hinge [ 'y_' + type ] ) static_data [ 'x' ] . append ( hinge [ 'x' ] ) static_data [ 'y' ] . append ( hinge [ 'y_' + type ] ) type = 'upper' if extra_points == 'lower' : static_data [ 'x' ] . append ( data [ 'x' ] [ i + 1 ] ) static_data [ 'y' ] . append ( data [ 'y' ] [ i + 1 ] ) static_data [ 'x' ] . append ( data [ 'x' ] [ i + 2 ] ) static_data [ 'y' ] . append ( data [ 'y' ] [ i + 2 ] ) flap_data [ 'x' ] . append ( xi ) flap_data [ 'y' ] . append ( yi ) else : if type == None : type = 'lower' elif type == 'upper' : if extra_points == 'upper' and len ( static_data [ 'x' ] ) == 0 : static_data [ 'x' ] . append ( data [ 'x' ] [ i - 2 ] ) static_data [ 'y' ] . append ( data [ 'y' ] [ i - 2 ] ) static_data [ 'x' ] . append ( data [ 'x' ] [ i - 1 ] ) static_data [ 'y' ] . append ( data [ 'y' ] [ i - 1 ] ) flap_data [ 'x' ] . append ( hinge [ 'x' ] ) flap_data [ 'y' ] . append ( hinge [ 'y_' + type ] ) static_data [ 'x' ] . append ( hinge [ 'x' ] ) static_data [ 'y' ] . append ( hinge [ 'y_' + type ] ) type = 'lower' static_data [ 'x' ] . append ( xi ) static_data [ 'y' ] . append ( yi ) return static_data , flap_data
short_docstring: Create the static airfoil and flap dictionaries containing the outer
  mold coordinates of both.
short_docstring_tokens: Create the static airfoil and flap dictionaries containing the outer mold coordinates of both .
comment: """Create the static airfoil and flap dictionaries containing the outer
      mold coordinates of both. Because it is necessary to have an intersection
      between the static lower surface and the flap lower surface, it is
      sometimes interesting to have an extra poin in the static surface to 
      garantee the intersection.
      
      :param data: dictionary with x and y cooridnates of the whole outer mold
      
      :param hinge: dictionary with x and y coordinates of hinge. Can be found
                    via find_hinge.
                    
      :param extra_points: include extra points to surface, extending it more
                           than it will actually be (usefull for intersecting
                           lines). Avaialble options: 'lower', 'upper' and None"""$SEP$#Generate empty dictionaries which will store final data.$SEP$#Because of the way that xfoil works, the upper list will always$SEP$#begin from the trailing edge    $SEP$# this will make the at the hinge to be included only once$SEP$#If the extra point is unecessary in the lower$SEP$#Because of the way that xfoil works, the lower list will always$SEP$#begin from the  leading edge  $SEP$#If the extra point is unecessary in the upper$SEP$# this will make the at the hinge to be included only once