Vulcan
Aerospace Engineering Utilities Built on Janus
Loading...
Searching...
No Matches
ConstantWind.hpp
Go to the documentation of this file.
1// Constant Wind Field Model
2// Simple constant wind vector in NED frame
3#pragma once
4
6
8
9// ============================================================================
10// Constant Wind from NED Components
11// ============================================================================
12
22template <typename Scalar>
23wind::WindVector<Scalar> from_ned(const Scalar &north, const Scalar &east,
24 const Scalar &down = Scalar(0)) {
25 return wind::WindVector<Scalar>{.north = north, .east = east, .down = down};
26}
27
28// ============================================================================
29// Constant Wind from Speed and Direction
30// ============================================================================
31
45template <typename Scalar>
47 const Scalar &direction_from) {
48 // Wind blows FROM direction_from, so velocity is in opposite direction
49 // North component: -speed * cos(direction_from)
50 // East component: -speed * sin(direction_from)
52 .north = -speed * janus::cos(direction_from),
53 .east = -speed * janus::sin(direction_from),
54 .down = speed * Scalar(0) // Zero down component, maintain scalar type
55 };
56}
57
58} // namespace vulcan::constant_wind
Definition ConstantWind.hpp:7
wind::WindVector< Scalar > from_ned(const Scalar &north, const Scalar &east, const Scalar &down=Scalar(0))
Create constant wind from NED components.
Definition ConstantWind.hpp:23
wind::WindVector< Scalar > from_speed_direction(const Scalar &speed, const Scalar &direction_from)
Create constant wind from speed and direction.
Definition ConstantWind.hpp:46
3D wind velocity in NED frame
Definition WindTypes.hpp:21