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:
- 0:a6a169de725f
- Child:
- 19:ce7fdade3534
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Estimation/CartPosition/CartPosition.h Mon May 27 13:26:03 2013 +0000
@@ -0,0 +1,43 @@
+#ifndef __CARTPOSITION_H
+#define __CARTPOSITION_H
+
+/** Geographical position and calculation based on cartesian coordinates
+ */
+class CartPosition {
+public:
+ /** 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);
+ /** 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;
+ /** y coordinate of this object */
+ float _y;
+};
+#endif
\ No newline at end of file