import math


def Naca_00XX(c, t, x_list):
    """
    Generates a simetric NACA airfoil.
    Inputs:
    :param c: chord
    :param t: max thickness as a fraction of the chord.
    :param x_list: points between 0 and c (chord lenght) 
     
    Returns dictionary with keys 'u'pper and 'l'ower
    
    The Naca function can be found in: https://en.wikipedia.org/wiki/NACA_airfoil  

    Created on Wed Feb 03 12:50:52 2016
    
    @author: Endryws and Pedro Leal
    """
    y_upper = []
    y_lower = []
    for x in x_list:
        xc= x/c # Is just for increase speed and facilitate future changes.
        a1 = 5*t*c
        t1 = 0.2969*(math.sqrt(xc))
        t2 = -0.1260*xc
        t3 = -0.3516*(xc**2)
        t4 = 0.2843*(xc**3)
        t5 = -0.1015*(xc**4)
        y = (a1*(t1+t2+t3+t4+t5))
        y_upper.append(y)
        y_lower.append(y*(-1)) # is just for pick the y axis
                                       # negative numbers
    y = {'u': y_upper, 'l':y_lower}
    return y