summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Peter <blendoit@gmail.com>2019-06-06 16:52:39 -0700
committerMarius Peter <blendoit@gmail.com>2019-06-06 16:52:39 -0700
commitee69827c8efa1b563897e37a5ed220c7fadbb2e3 (patch)
tree9c0780d952551339e04c91334d6485d34fa84776
parent50557a765e812beca9b9ef7d92af0828bd7bd0d4 (diff)
Testing the integration between Atom editor and GitHub.
-rw-r--r--__init__.py4
-rw-r--r--__pycache__/creator.cpython-37.pycbin0 -> 9785 bytes
-rw-r--r--creator.py40
3 files changed, 25 insertions, 19 deletions
diff --git a/__init__.py b/__init__.py
index a7e70a3..3e60a6f 100644
--- a/__init__.py
+++ b/__init__.py
@@ -5,7 +5,7 @@
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# This program is distributed in the hope that it will be useful,
+# This program is distribguted in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
@@ -15,3 +15,5 @@
__author__ = "Marius Peter"
__version__ = "2.1"
__revision__ = "2.1.1"
+
+# Foobie foobar
diff --git a/__pycache__/creator.cpython-37.pyc b/__pycache__/creator.cpython-37.pyc
new file mode 100644
index 0000000..9933593
--- /dev/null
+++ b/__pycache__/creator.cpython-37.pyc
Binary files differ
diff --git a/creator.py b/creator.py
index 59c8436..f826a14 100644
--- a/creator.py
+++ b/creator.py
@@ -22,7 +22,7 @@ import matplotlib.pyplot as plt
import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3D
-
+# hello im just dicking around
# This variable is required for main.py constant wing dimensions
# to be passed to inheriting classes (Airfoil, Spar, Stringer, Rib).
# This way, we don't have to redeclare our coordinates as parameters for
@@ -117,13 +117,12 @@ class Airfoil(Coordinates):
x_c = x
y_c = float()
if 0 <= x < p_c:
- y_c = (m / (p ** 2)) * (2 * p
- * (x / self.chord)
- - (x / self.chord) ** 2)
+ y_c = (m / (p**2)) * (2 * p * (x / self.chord) -
+ (x / self.chord)**2)
elif p_c <= x <= self.chord:
- y_c = (m / ((1 - p) ** 2)) * ((1 - 2 * p)
- + 2 * p * (x / self.chord)
- - (x / self.chord) ** 2)
+ y_c = (m /
+ ((1 - p)**2)) * ((1 - 2 * p) + 2 * p *
+ (x / self.chord) - (x / self.chord)**2)
else:
print('x-coordinate for camber is out of bounds. '
'Check that 0 < x <= chord.')
@@ -135,11 +134,12 @@ class Airfoil(Coordinates):
"""
y_t = float()
if 0 <= x <= self.chord:
- y_t = 5 * t * self.chord * (0.2969 * sqrt(x / self.chord)
- - 0.1260 * (x / self.chord)
- - 0.3516 * (x / self.chord) ** 2
- + 0.2843 * (x / self.chord) ** 3
- - 0.1015 * (x / self.chord) ** 4)
+ y_t = 5 * t * self.chord * (0.2969 * sqrt(x / self.chord) -
+ 0.1260 *
+ (x / self.chord) - 0.3516 *
+ (x / self.chord)**2 + 0.2843 *
+ (x / self.chord)**3 - 0.1015 *
+ (x / self.chord)**4)
else:
print('x-coordinate for thickness is out of bounds. '
'Check that 0 < x <= chord.')
@@ -151,9 +151,9 @@ class Airfoil(Coordinates):
"""
dy_c = float()
if 0 <= x < p_c:
- dy_c = ((2 * m)/p ** 2) * (p - x / self.chord)
+ dy_c = ((2 * m) / p**2) * (p - x / self.chord)
elif p_c <= x <= self.chord:
- dy_c = (2 * m) / ((1 - p) ** 2) * (p - x / self.chord)
+ dy_c = (2 * m) / ((1 - p)**2) * (p - x / self.chord)
return dy_c
def get_theta(dy_c):
@@ -169,7 +169,7 @@ class Airfoil(Coordinates):
elif x == self.chord:
x_u = x - self.y_t[x] * sin(self.theta[x])
y_u = 0 # Make upper curve finish at y = 0
- return(x_u, y_u)
+ return (x_u, y_u)
def get_lower_coordinates(x):
x_l = float()
@@ -180,7 +180,7 @@ class Airfoil(Coordinates):
elif x == self.chord:
x_l = (x + self.y_t[x] * sin(self.theta[x]))
y_l = 0 # Make lower curve finish at y = 0
- return(x_l, y_l)
+ return (x_l, y_l)
# Generate all our wing geometries from previous sub-functions
for x in range(0, self.chord + 1):
@@ -233,7 +233,7 @@ class Airfoil(Coordinates):
Save all the declared geometry to save_dir_path (must be full path).
"""
file_name = 'airfoil_%s' % airfoil_number
- full_path = os.path.join(save_dir_path, file_name+'.txt')
+ full_path = os.path.join(save_dir_path, file_name + '.txt')
file = open(full_path, 'w')
sys.stdout = file
self.print_geometry(4)
@@ -341,7 +341,11 @@ def plot(airfoil, spar):
y_chord = [0, 0]
plt.plot(x_chord, y_chord, linewidth='1')
# Plot mean camber line
- plt.plot(airfoil.x_c, airfoil.y_c, '-.', color='r', linewidth='2',
+ plt.plot(airfoil.x_c,
+ airfoil.y_c,
+ '-.',
+ color='r',
+ linewidth='2',
label='mean camber line')
# Plot upper surface
plt.plot(airfoil.x_u, airfoil.y_u, '', color='b', linewidth='1')
Copyright 2019--2024 Marius PETER