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
CartPosition Class Reference
Geographical position and calculation based on cartesian coordinates. More...
#include <CartPosition.h>
| Public Member Functions | |
| CartPosition (void) | |
| Create a new cartesian coordinate object. | |
| CartPosition (float x, float y) | |
| Create a new cartesian coordinate object. | |
| void | set (float x, float y) | 
| Sets coordinates for object. | |
| CartPosition & | operator= (CartPosition p) | 
| Shorthand for set. | |
| void | set (CartPosition p) | 
| Sets coordinates for object. | |
| float | bearingTo (CartPosition to) | 
| Computes bearing to a position from this position. | |
| float | distanceTo (CartPosition to) | 
| Computes distance to a position from this position. | |
| void | move (float bearing, float distance) | 
| Computes the new coordinates for this object given a bearing and distance. | |
| Data Fields | |
| float | x | 
| x coordinate of this object | |
| float | y | 
| y coordinate of this object | |
Detailed Description
Geographical position and calculation based on cartesian coordinates.
Definition at line 6 of file CartPosition.h.
Constructor & Destructor Documentation
| CartPosition | ( | void | ) | 
Create a new cartesian coordinate object.
Definition at line 6 of file CartPosition.cpp.
| CartPosition | ( | float | x, | 
| float | y | ||
| ) | 
Create a new cartesian coordinate object.
- Parameters:
- 
  x sets x coordinate y sets y coordinate 
Definition at line 11 of file CartPosition.cpp.
Member Function Documentation
| float bearingTo | ( | CartPosition | to ) | 
Computes bearing to a position from this position.
- Parameters:
- 
  to is the coordinate to which we're calculating bearing 
Definition at line 31 of file CartPosition.cpp.
| float distanceTo | ( | CartPosition | to ) | 
Computes distance to a position from this position.
- Parameters:
- 
  to is the coordinate to which we're calculating distance 
Definition at line 39 of file CartPosition.cpp.
| void move | ( | float | bearing, | 
| float | distance | ||
| ) | 
Computes the new coordinates for this object given a bearing and distance.
- Parameters:
- 
  bearing is the direction traveled is the distance traveled 
Definition at line 47 of file CartPosition.cpp.
| CartPosition & operator= | ( | CartPosition | p ) | 
Shorthand for set.
Definition at line 59 of file CartPosition.cpp.
| void set | ( | CartPosition | p ) | 
Sets coordinates for object.
- Parameters:
- 
  p sets coordinates of this object to that of p 
Definition at line 18 of file CartPosition.cpp.
| void set | ( | float | x, | 
| float | y | ||
| ) | 
Sets coordinates for object.
- Parameters:
- 
  x sets x coordinate y sets y coordinate 
Definition at line 24 of file CartPosition.cpp.
Field Documentation
| float x | 
x coordinate of this object
Definition at line 49 of file CartPosition.h.
| float y | 
y coordinate of this object
Definition at line 52 of file CartPosition.h.
Generated on Tue Jul 12 2022 21:36:19 by
 1.7.2
 1.7.2