OLD | NEW |
1 /* | 1 /* |
2 This file is part of LilyPond, the GNU music typesetter. | 2 This file is part of LilyPond, the GNU music typesetter. |
3 | 3 |
4 Copyright (C) 1997--2020 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1997--2020 Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 | 5 |
6 LilyPond is free software: you can redistribute it and/or modify | 6 LilyPond is free software: you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 7 it under the terms of the GNU General Public License as published by |
8 the Free Software Foundation, either version 3 of the License, or | 8 the Free Software Foundation, either version 3 of the License, or |
9 (at your option) any later version. | 9 (at your option) any later version. |
10 | 10 |
11 LilyPond is distributed in the hope that it will be useful, | 11 LilyPond is distributed in the hope that it will be useful, |
12 but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 GNU General Public License for more details. | 14 GNU General Public License for more details. |
15 | 15 |
16 You should have received a copy of the GNU General Public License | 16 You should have received a copy of the GNU General Public License |
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>. | 17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>. |
18 */ | 18 */ |
19 | 19 |
| 20 // Needed because of extension definitions for POSIX functions. |
| 21 #include "config.hh" |
| 22 |
20 #include "offset.hh" | 23 #include "offset.hh" |
21 | 24 |
| 25 #include <cmath> |
| 26 |
22 using std::string; | 27 using std::string; |
23 | 28 |
24 #ifndef STANDALONE | 29 #ifndef STANDALONE |
25 string | 30 string |
26 Offset::to_string () const | 31 Offset::to_string () const |
27 { | 32 { |
28 string s; | 33 string s; |
29 s = string (" (") + std::to_string (coordinate_a_[X_AXIS]) + ", " | 34 s = string (" (") + std::to_string (coordinate_a_[X_AXIS]) + ", " |
30 + std::to_string (coordinate_a_[Y_AXIS]) + ")"; | 35 + std::to_string (coordinate_a_[Y_AXIS]) + ")"; |
31 return s; | 36 return s; |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 else | 185 else |
181 return Offset (sin ((90 - angle) * M_PI/180.0), | 186 return Offset (sin ((90 - angle) * M_PI/180.0), |
182 sin (angle * M_PI/180.0)); | 187 sin (angle * M_PI/180.0)); |
183 else if (angle < -90) | 188 else if (angle < -90) |
184 return Offset (sin ((90 + angle) * M_PI/180.0), | 189 return Offset (sin ((90 + angle) * M_PI/180.0), |
185 sin ((-180 - angle) * M_PI/180.0)); | 190 sin ((-180 - angle) * M_PI/180.0)); |
186 else | 191 else |
187 return Offset (sin ((90 + angle) * M_PI/180.0), | 192 return Offset (sin ((90 + angle) * M_PI/180.0), |
188 sin (angle * M_PI/180.0)); | 193 sin (angle * M_PI/180.0)); |
189 } | 194 } |
OLD | NEW |