<commit_before># -*- coding: utf-8 -*-
"""
Created on Wed Feb 03 12:50:52 2016

@author: Endryws
"""
def Naca(c, t, x_list):
    yt = []
    yt_inside = []
    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_inside = y*p
        yt.append(y)
        yt_inside.append(y_inside)
    return yt,yt_inside
 

if __name__ == '__main__':
    import matplotlib.pyplot as plt
    import numpy as np
    import math

    c = 1 #c is the chord length
    t = 0.12 # is the maximum thickness as a fraction of the chord 
             #(t*100 = the last two nunbers of the NACA denomination)
    
    number_of_points = 200
    
    p = 0.5 #this variabel is here to force the points fall inside the model.
        
    xt = np.linspace(.001,c,number_of_points) # This function receives inicial
                                          # point,finalpoin,number of therms 
                                         #between inicial and final point
    
    yt,yt_inside = Naca(c,t,xt)
    
    fig = plt.figure()

    fig.add_subplot(111)
    plt.scatter(xt,yt)
    plt.scatter(xt,yt_inside,c='r' )

    yt_neg = [ -y for y in yt] # is just for pick the negative numbers
    yt_inside_neg = [ -y for y in yt_inside]
    
    plt.scatter(xt,yt_neg)
    plt.scatter(xt,yt_inside_neg,c='r')
    
    plt.grid()
    plt.xlabel('xt')
    plt.ylabel('yt')<commit_msg>Adicionei alguns comentários e  separei a função NACA 00XX<commit_after># -*- coding: utf-8 -*-
"""
Created on Wed Feb 03 12:50:52 2016

@author: Endryws
"""

"""
The Naca function can be found in: https://en.wikipedia.org/wiki/NACA_airfoil
This function generates the  a simetric NACA airfoil;
receives x_list => points between 0 and c (chord lenght) 
          
"""
def Naca_00XX(c, t, x_list):
    y_list = []
    y_negative_list = []
    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_list.append(y)
        y_negative_list.append(y*(-1)) # is just for pick the y axis
                                       # negative numbers
    return y_list,y_negative_list
    
     

if __name__ == '__main__':
    import matplotlib.pyplot as plt
    import numpy as np
    import math

    c = 1 #c is the chord length
    t = 0.12 # is the maximum thickness as a fraction of the chord 
             #(t*100 = the last two nunbers of the NACA denomination)
    
    number_of_points = 200
    
    p = 0.5 #this variabel is here to force the points fall inside the model.
        
    x_list = np.linspace(.001,c,number_of_points)  # This function receives 
                                                   # inicial point,finalpoint,
                                                   #number of therms between 
                                                   # inicial and final point
    
    y_list,y_negative_list = Naca_00XX(c,t,x_list)
    
    
    fig = plt.figure()

    fig.add_subplot(111)
    plt.scatter(x_list,y_list)
    plt.scatter(x_list,y_negative_list)

    
    plt.grid()
    plt.xlabel('x values')
    plt.ylabel('y values')
{'fraction_non_alphanumeric': 0.10651056539120503, 'fraction_numerical': 0.043403769274700174, 'mean_word_length': 1.822723609991942, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6352827', 'n_tokens_mistral': 1320, 'n_tokens_neox': 1203, 'n_words': 331}