Calculate range between two vehicles given their respective positions
Aerospace Blockset / GNC / Guidance
The Calculate Range block computes the range between two vehicles. The equation used for the range calculation is
x1 — Vehicle 1 position
Contains the (x, y, and z) position of vehicle 1, specified as a three-element vector. These values of the double data type.
x2 — Vehicle 2 position
The (x, y, and z) position of vehicle 2, specified as a three-element vector. These values are of the double data type.
R2-1 — Range
Range from vehicle 2 and vehicle 1, returned as a scalar of double data type. The calculated range is the magnitude of the distance, but not the direction. It is always positive or zero.
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Introduced before R2006a