Miroslaw K. / Mbed 2 deprecated RadarDemo

Dependencies:   BSP_DISCO_F746NG Graphics mbed TS_DISCO_F746NG

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Location.h Source File

Location.h

00001 /*
00002     Location.h - class defines 3D location in cartesian and angular coordinations.
00003 
00004     Copyright(c) 2016 karpent at gmail.com, MIT License
00005 
00006     Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"),
00007     to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
00008     and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
00009 
00010     The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
00011 
00012     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00013     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
00014     OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
00015     THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00016 */
00017 
00018 #pragma once
00019 
00020 /**
00021   * @brief Class defines 3D location in cartesian and angular coordinations.
00022   */
00023 class Location
00024 {
00025 public:
00026     Location();
00027     Location(float x, float y, float height);
00028 
00029     /// <summary>
00030     /// Sets the location.
00031     /// </summary>
00032     /// <param name="x">The x position win world coordinates in [km].</param>
00033     /// <param name="y">The y position win world coordinates in [km].</param>
00034     /// <param name="height">Target height in [km].</param>
00035     void SetLocation(float x, float y, float height);
00036 
00037     /// <summary>
00038     /// Sets the location angular.
00039     /// </summary>
00040     /// <param name="distance">The distance.</param>
00041     /// <param name="azimuth">The azimuth.</param>
00042     /// <param name="elevation">The elevation.</param>
00043     void SetLocationAngular(float distance, float azimuth, float elevation);
00044 
00045     float GetX();
00046     float GetY();
00047     float GetHeight();
00048 
00049     float GetDistance();
00050     float GetAzimuth();
00051     float GetElevation();
00052 
00053     void ToAngular();
00054     void ToCartesian();
00055 
00056 private:
00057     float _x;
00058     float _y;
00059     float _h;
00060     float _distance;
00061     float _azimuth;
00062     float _elevation;
00063 };
00064