5dbde6512203cb4a62e5422a1b908c403b74bc35
Stefan Schuermans initial version, DXFs can b...

Stefan Schuermans authored 11 years ago

1) /* drawing (DXF) to G-code (NGC) converter
2)  * Copyright 2013 Stefan Schuermans <stefan@schuermans.info>
Stefan Schuermans license CC-BY-SA --> GPL (m...

Stefan Schuermans authored 11 years ago

3)  * Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html
Stefan Schuermans initial version, DXFs can b...

Stefan Schuermans authored 11 years ago

4)  */
5) 
6) #ifndef POINT_H
7) #define POINT_H
8) 
9) /// point in 2D space
10) class Point {
11) public:
12)   Point();
13)   Point(double x, double y);
14)   double abs_sq() const;
15)   double abs() const;
16)   Point operator-() const;
17)   Point operator+(const Point &that) const;
18)   Point operator-(const Point &that) const;
19)   Point operator*(double factor) const;
20)   Point operator/(double factor) const;
21)   Point &operator+=(const Point &that);
22)   Point &operator-=(const Point &that);
23)   Point &operator*=(double factor);
24)   Point &operator/=(double factor);
Stefan Schuermans implement joining and impro...

Stefan Schuermans authored 11 years ago

25) 
26)   /**
27)    * @brief check if point is equal to another one
28)    * @param[in] that other point
29)    * @param[in] eqDist maximum distance of two points to be considered equal
30)    */
31)   bool equals(const Point &that, double eqDist) const;
32) 
Stefan Schuermans supoort rotation around z axis

Stefan Schuermans authored 11 years ago

33)   /**
34)    * @brief rotate around origin
35)    * @param[in] rad angle in radians
36)    * @return rotated point
37)    */
38)   Point rotate(double rad) const;
39) 
Stefan Schuermans implement scaling

Stefan Schuermans authored 11 years ago

40)   /**
41)    * @brief scale differently in X and Y direction
42)    * @param[in] fx scale factor in X direction
43)    * @param[in] fy scale factor in Y direction
44)    * @return scaled point
45)    */
46)   Point scale_xy(double fx, double fy) const;
47)