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
Classes/Vector.h@3:07109a6bb472, 2020-03-12 (annotated)
- Committer:
- EISR
- Date:
- Thu Mar 12 15:22:02 2020 +0000
- Revision:
- 3:07109a6bb472
- Parent:
- 2:1103f5d61035
commentaires de la partie bluetooth;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Wael_H | 0:8743b606abc3 | 1 | #ifndef VECTOR_H |
| Wael_H | 0:8743b606abc3 | 2 | #define VECTOR_H |
| Wael_H | 0:8743b606abc3 | 3 | |
| Wael_H | 2:1103f5d61035 | 4 | #include "mbed.h" |
| Wael_H | 2:1103f5d61035 | 5 | |
| Wael_H | 2:1103f5d61035 | 6 | struct Point |
| Wael_H | 0:8743b606abc3 | 7 | { |
| Wael_H | 2:1103f5d61035 | 8 | Point() {x=0; y=0;} |
| Wael_H | 2:1103f5d61035 | 9 | Point(int x, int y) : x(x), y(y) {} |
| Wael_H | 0:8743b606abc3 | 10 | int x; |
| Wael_H | 0:8743b606abc3 | 11 | int y; |
| Wael_H | 2:1103f5d61035 | 12 | }; |
| Wael_H | 0:8743b606abc3 | 13 | |
| Wael_H | 0:8743b606abc3 | 14 | class Vector |
| Wael_H | 0:8743b606abc3 | 15 | { |
| Wael_H | 0:8743b606abc3 | 16 | public: |
| Wael_H | 0:8743b606abc3 | 17 | Vector(int x0, int y0, int x1, int y1); |
| Wael_H | 0:8743b606abc3 | 18 | Vector(Point p0, Point p1); |
| Wael_H | 0:8743b606abc3 | 19 | Vector(); |
| Wael_H | 0:8743b606abc3 | 20 | void orienteVersLeHaut(); // fct qui met la pointe du Vector (p1) vers le haut (dans une console (y inversés donc)) |
| Wael_H | 0:8743b606abc3 | 21 | float getCoeffDir() const; |
| Wael_H | 0:8743b606abc3 | 22 | int getNorme() const; |
| Wael_H | 0:8743b606abc3 | 23 | bool estADroiteDe(Vector& v) const; |
| Wael_H | 2:1103f5d61035 | 24 | Vector testJoinedTo(Vector& v) const; // Test si les deux sont joints par un point ; si oui il retourne le nouveau vecteur (AB + BC + AC), si non il retourne le vecteur suivant : Vector(0, 0, 0, 0) |
| Wael_H | 2:1103f5d61035 | 25 | int calcDifference(Vector& v1, Vector& v2) const; |
| Wael_H | 2:1103f5d61035 | 26 | Point projection() const; |
| Wael_H | 0:8743b606abc3 | 27 | static Vector getVectorAuMilieuDe(Vector& v0, Vector& v1); |
| Wael_H | 0:8743b606abc3 | 28 | |
| Wael_H | 2:1103f5d61035 | 29 | bool operator==(const Vector& v); |
| Wael_H | 2:1103f5d61035 | 30 | bool operator!=(const Vector& v); |
| Wael_H | 2:1103f5d61035 | 31 | |
| Wael_H | 2:1103f5d61035 | 32 | static Vector v1_ideal; |
| Wael_H | 2:1103f5d61035 | 33 | static Vector v2_ideal; |
| Wael_H | 2:1103f5d61035 | 34 | |
| Wael_H | 2:1103f5d61035 | 35 | void affVector(Serial& serial) const; |
| Wael_H | 2:1103f5d61035 | 36 | |
| Wael_H | 0:8743b606abc3 | 37 | private: |
| Wael_H | 0:8743b606abc3 | 38 | Point p0, p1; |
| Wael_H | 0:8743b606abc3 | 39 | }; |
| Wael_H | 0:8743b606abc3 | 40 | |
| Wael_H | 2:1103f5d61035 | 41 | |
| Wael_H | 0:8743b606abc3 | 42 | #endif // VECTOR_H |