Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions docs/Components/Aerodynamic/RectangularHorizontalStabilizer.md
Original file line number Diff line number Diff line change
@@ -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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last change: missing the instruction to pass mass and name parameters.

```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
```
28 changes: 28 additions & 0 deletions tests/Components/test_Aerodynamic.py
Original file line number Diff line number Diff line change
@@ -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)