From a6f68571d13ec9a7e8c0b4396927f2e6541f0916 Mon Sep 17 00:00:00 2001 From: Cassiano Montibeller Date: Sun, 4 Oct 2020 16:16:27 -0300 Subject: [PATCH 1/2] Add test for RectangularHorizontalStabilizer --- tests/Components/test_Aerodynamic.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/Components/test_Aerodynamic.py diff --git a/tests/Components/test_Aerodynamic.py b/tests/Components/test_Aerodynamic.py new file mode 100644 index 0000000..b6a957f --- /dev/null +++ b/tests/Components/test_Aerodynamic.py @@ -0,0 +1,28 @@ +import attr +from vec import Vector2 +import math +import numpy.testing as npt +import pytest +from adr.Components.Aerodynamic import RectangularHorizontalStabilizer + + +@pytest.fixture +def rectangular_horizontal_stabilizer(): + rectangular_horizontal_stabilizer = RectangularHorizontalStabilizer( + name='rectangular_horizontal_stabilizer', + relative_position=Vector2(x=-0.7, y=0.2), + relative_angle=math.radians(0), + mass=0.15, + span=0.15, + chord=0.20 + ) + return rectangular_horizontal_stabilizer + + +def test_rectangular_aerodynamic_stabilizer(rectangular_horizontal_stabilizer): + assert (rectangular_horizontal_stabilizer.type == 'horizontal_stabilizer') + assert (rectangular_horizontal_stabilizer.name == + 'rectangular_horizontal_stabilizer') + assert (rectangular_horizontal_stabilizer.span == 0.15) + assert (rectangular_horizontal_stabilizer.chord == 0.20) + assert (rectangular_horizontal_stabilizer.mass == 0.15) From 6dbb988c8e5319a7e787d02c01925a6c36c304cc Mon Sep 17 00:00:00 2001 From: Cassiano Montibeller Date: Sun, 4 Oct 2020 16:16:27 -0300 Subject: [PATCH 2/2] Add docs for RectangularHorizontalStabilizer --- .../RectangularHorizontalStabilizer.md | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 docs/Components/Aerodynamic/RectangularHorizontalStabilizer.md diff --git a/docs/Components/Aerodynamic/RectangularHorizontalStabilizer.md b/docs/Components/Aerodynamic/RectangularHorizontalStabilizer.md new file mode 100644 index 0000000..714ba63 --- /dev/null +++ b/docs/Components/Aerodynamic/RectangularHorizontalStabilizer.md @@ -0,0 +1,32 @@ +## RectangularHorizontalStabilizer +This class is responsible for creating a rectangular horizontal stabilizer type component. For this, it is necessary to pass as parameters the position and the angle in relation to the parent component, as well as the chord and span of the rectangular horizontal stabilizer. +```python +from vec import Vector2 +import math +import pytest +from adr.Components.Aerodynamic import RectangularHorizontalStabilizer + +rectangular_horizontal_stabilizer = RectangularHorizontalStabilizer( + name='rectangular_horizontal_stabilizer', + relative_position=Vector2(x=-0.7, y=0.2), + relative_angle=math.radians(0), + mass=0.14, + span=0.15, + chord=0.20 +) + +print(rectangular_horizontal_stabilizer.name) +>>> rectangular_horizontal_stabilizer + +print(rectangular_horizontal_stabilizer.type) +>>> horizontal_stabilizer + +print(rectangular_horizontal_stabilizer.mass) +>>> 0.14 + +print(rectangular_horizontal_stabilizer.span) +>>> 0.15 + +print(rectangular_horizontal_stabilizer.chord) +>>> 0.2 +``` \ No newline at end of file