Michael Shimniok / Mbed 2 deprecated DataBus

Dependencies:   mbed Watchdog SDFileSystem DigoleSerialDisp

Committer:
shimniok
Date:
Mon May 27 13:26:03 2013 +0000
Revision:
0:a6a169de725f
Child:
19:ce7fdade3534
Working version with priorities set and update time display

Who changed what in which revision?

UserRevisionLine numberNew contents of line
shimniok 0:a6a169de725f 1 #ifndef __CARTPOSITION_H
shimniok 0:a6a169de725f 2 #define __CARTPOSITION_H
shimniok 0:a6a169de725f 3
shimniok 0:a6a169de725f 4 /** Geographical position and calculation based on cartesian coordinates
shimniok 0:a6a169de725f 5 */
shimniok 0:a6a169de725f 6 class CartPosition {
shimniok 0:a6a169de725f 7 public:
shimniok 0:a6a169de725f 8 /** Create a new cartesian coordinate object
shimniok 0:a6a169de725f 9 */
shimniok 0:a6a169de725f 10 CartPosition(void);
shimniok 0:a6a169de725f 11 /** Create a new cartesian coordinate object
shimniok 0:a6a169de725f 12 * @param x sets x coordinate
shimniok 0:a6a169de725f 13 * @param y sets y coordinate
shimniok 0:a6a169de725f 14 */
shimniok 0:a6a169de725f 15 CartPosition(float x, float y);
shimniok 0:a6a169de725f 16 /** Sets coordinates for object
shimniok 0:a6a169de725f 17 * @param x sets x coordinate
shimniok 0:a6a169de725f 18 * @param y sets y coordinate
shimniok 0:a6a169de725f 19 */
shimniok 0:a6a169de725f 20 void set(float x, float y);
shimniok 0:a6a169de725f 21 /** Sets coordinates for object
shimniok 0:a6a169de725f 22 * @param p sets coordinates of this object to that of p
shimniok 0:a6a169de725f 23 */
shimniok 0:a6a169de725f 24 void set(CartPosition p);
shimniok 0:a6a169de725f 25 /** Computes bearing to a position from this position
shimniok 0:a6a169de725f 26 * @param to is the coordinate to which we're calculating bearing
shimniok 0:a6a169de725f 27 */
shimniok 0:a6a169de725f 28 float bearingTo(CartPosition to);
shimniok 0:a6a169de725f 29 /** Computes distance to a position from this position
shimniok 0:a6a169de725f 30 * @param to is the coordinate to which we're calculating distance
shimniok 0:a6a169de725f 31 */
shimniok 0:a6a169de725f 32 float distanceTo(CartPosition to);
shimniok 0:a6a169de725f 33 /** Computes the new coordinates for this object given a bearing and distance
shimniok 0:a6a169de725f 34 * @param bearing is the direction traveled
shimniok 0:a6a169de725f 35 * @distance is the distance traveled
shimniok 0:a6a169de725f 36 */
shimniok 0:a6a169de725f 37 void move(float bearing, float distance);
shimniok 0:a6a169de725f 38 /** x coordinate of this object */
shimniok 0:a6a169de725f 39 float _x;
shimniok 0:a6a169de725f 40 /** y coordinate of this object */
shimniok 0:a6a169de725f 41 float _y;
shimniok 0:a6a169de725f 42 };
shimniok 0:a6a169de725f 43 #endif