NACA00XX symmetric airfoil coordinate generator

Version 1.0.0 (2.14 KB) by Xiaowei He
NACA 4-digit symmetric airfoil coordinate generator with writing to file and split coordinate functions
43 Downloads
Updated 28 Mar 2022

View License

This MATLAB function generates x- and y- coordinates of a standard NACA00XX airfoil (with non-closed trailing edge) with determined chord length and number of data points. The x-coordinates start from the trailing edge to the leading edge and return to the trailing edge.
Use input argument 'cos' to enable cosine x-coordinates, which generates denser data points near the leading edge.
Use input argument 'write2file' to enable writing coordinates to a .txt, .csv, or .dat file (or two files when coordinate split is enabled). MATLAB R2013b or newer version required if using this input argument.
Use output argument [foil_x, foil_y] or [foil_x_front, foil_y_front, foil_x_rear, foil_y_rear] to swith between continous output or splitted output in which the airfoil coordinates are splitted at the maximum thickness location.
% naca 00xx airfoil coordinates generator
% xh, 03/22/2022
% -------------------------------------------------------------------------
% [foil_x, foil_y] = naca00xxairfoil(naca, c, N, 'cos', 'write2file')
%
% [foil_x_front, foil_y_front, foil_x_rear, foil_y_rear] = naca00xxairfoil(naca, c, N, 'cos', 'write2file')
% -------------------------------------------------------------------------
% input:
% naca = 00xx;
% c = chord length;
% N = number of data points (odd number);
% 'cos' = cosine distribution of x-coordinate from leading edge;
% 'split' = split coordinates into front and rear at maximum thickness;
% 'write2file' = write to .txt, .csv, or .dat file, two sets of files if coordinate split enabled;
% 'write2file' can be 'txt', 'csv', or 'dat';
% -------------------------------------------------------------------------
% output:
% [foil_x, foil_y]
% foil_x = x-coordinate vector, trailing edge -> leading edge -> trailing edge;
% foil_y = y-coordinate vector, trailing edge -> leading edge -> trailing edge;
%
% [foil_x_front, foil_y_front, foil_x_rear, foil_y_rear]
% foil_x_front = x-coordinate vector, max thickness -> leading edge -> max thichness;
% foil_y_front = y-coordinate vector, max thickness -> leading edge -> max thichness;
% foil_x_rear = x-coordinate vector, max thickness -> trailing edge -> max thichness;
% foil_y_rear = y-coordinate vector, max thickness -> trailing edge -> max thichness;
%
% examples:
% linear x-coordinates without writing to file:
% [foil_x, foil_y] = naca00xxairfoil(naca, c, N)
%
% consine x-coordinates with writing to a .txt file:
% [foil_x, foil_y] = naca00xxairfoil(naca, c, N, 'cos', 'txt')
%
% linear x-coordinates splitted at max thickness with writing to a set of .csv file:
% [foil_x_front, foil_y_front, foil_x_rear, foil_y_rear] = naca00xxairfoil(naca, c, N, 'csv')
% -------------------------------------------------------------------------

Cite As

Xiaowei He (2024). NACA00XX symmetric airfoil coordinate generator (https://www.mathworks.com/matlabcentral/fileexchange/108964-naca00xx-symmetric-airfoil-coordinate-generator), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2021b
Compatible with R2013b and later releases
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0