-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdroite.h
55 lines (48 loc) · 1.43 KB
/
droite.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef DROITE_H
#define DROITE_H
#include "vector2d.h"
/**
* @brief The Droite class, a line that goes through an origin following a direction
*/
class Droite
{
private:
Vector2D o; /**< The origin of the line */
Vector2D d; /**< The direction of the line, normalized */
public:
Droite();
/**
* @brief Droite
* @param[in] p1 The origin of the line
* @param[in] p2 The direction of the line
*/
Droite(const Vector2D& p1,const Vector2D& p2) : o(p1), d(p2.normalized()) {}
/**
* @brief getIntersection Finds an intersection point with another Droite
* @param[in] a The Droite to intersect
* @param[out] point The intersection point
* @return True if the Droites intersect, else false.
*/
bool getIntersection(const Droite& a, Vector2D& point) const;
/**
* @brief Getter of o
* @return A copy of the origin
*/
Vector2D getO() const;
/**
* @brief Setter of o
* @param[in] value The new value of o
*/
void setO(const Vector2D& value);
/**
* @brief Getter of d
* @return A copy of the direction
*/
Vector2D getD() const;
/**
* @brief Setter of d
* @param[in] value The new value of d
*/
void setD(const Vector2D& value);
};
#endif // DROITE_H