From 7d0859d55a984a0c42111a620b3bb1ed7982c38e Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Thu, 4 Jul 2019 10:26:55 -0700 Subject: remove sqrt operator from creator --- creator.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'creator.py') diff --git a/creator.py b/creator.py index 22449bd..15425bc 100644 --- a/creator.py +++ b/creator.py @@ -29,7 +29,7 @@ Functions: import sys import os.path import numpy as np -from math import sin, cos, atan, sqrt +from math import sin, cos, atan import bisect as bi import matplotlib.pyplot as plt @@ -64,6 +64,8 @@ class Airfoil: @classmethod def from_dimensions(cls, chord, semi_span): + """Create airfoil from its chord and semi-span.""" + if chord > 20: cls.chord = chord else: @@ -114,8 +116,8 @@ class Airfoil: """Returns thickness from 1 'x' along the airfoil chord.""" x = 0 if x < 0 else x z_t = 5 * t * self.chord * ( - + 0.2969 * sqrt(x / self.chord) - - 0.1260 * (x / self.chord) + + 0.2969 * (x / self.chord) ** 0.5 + - 0.1260 * (x / self.chord) ** 1 - 0.3516 * (x / self.chord) ** 2 + 0.2843 * (x / self.chord) ** 3 - 0.1015 * (x / self.chord) ** 4) -- cgit v1.2.3