Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed Watchdog SDFileSystem DigoleSerialDisp
Diff: Estimation/CartPosition/CartPosition.h
- Revision:
- 19:ce7fdade3534
- Parent:
- 0:a6a169de725f
--- a/Estimation/CartPosition/CartPosition.h Thu Nov 29 17:21:37 2018 +0000
+++ b/Estimation/CartPosition/CartPosition.h Thu Nov 29 17:26:39 2018 +0000
@@ -8,36 +8,47 @@
/** Create a new cartesian coordinate object
*/
CartPosition(void);
+
/** Create a new cartesian coordinate object
* @param x sets x coordinate
* @param y sets y coordinate
*/
CartPosition(float x, float y);
+
/** Sets coordinates for object
* @param x sets x coordinate
* @param y sets y coordinate
*/
void set(float x, float y);
+
+ /** Shorthand for set */
+ CartPosition& operator= (CartPosition p);
+
/** Sets coordinates for object
* @param p sets coordinates of this object to that of p
*/
void set(CartPosition p);
+
/** Computes bearing to a position from this position
* @param to is the coordinate to which we're calculating bearing
*/
float bearingTo(CartPosition to);
+
/** Computes distance to a position from this position
* @param to is the coordinate to which we're calculating distance
*/
float distanceTo(CartPosition to);
+
/** Computes the new coordinates for this object given a bearing and distance
* @param bearing is the direction traveled
* @distance is the distance traveled
*/
void move(float bearing, float distance);
+
/** x coordinate of this object */
- float _x;
+ float x;
+
/** y coordinate of this object */
- float _y;
+ float y;
};
-#endif
\ No newline at end of file
+#endif