-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMaths_8h.html
427 lines (395 loc) · 34.6 KB
/
Maths_8h.html
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.8"/>
<title>MapMap: Maths.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">MapMap
 <span id="projectnumber">0.3.2</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.8 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>File Members</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">Maths.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include <QtGlobal></code><br />
<code>#include <cmath></code><br />
</div><div class="textblock"><div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
<img id="dynsection-0-trigger" src="closed.png" alt="+"/> Include dependency graph for Maths.h:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="Maths_8h__incl.png" border="0" usemap="#Maths_8h" alt=""/></div>
</div>
</div><div class="textblock"><div id="dynsection-1" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
<img id="dynsection-1-trigger" src="closed.png" alt="+"/> This graph shows which files directly or indirectly include this file:</div>
<div id="dynsection-1-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-1-content" class="dyncontent" style="display:none;">
<div class="center"><img src="Maths_8h__dep__incl.png" border="0" usemap="#Maths_8hdep" alt=""/></div>
<map name="Maths_8hdep" id="Maths_8hdep">
<area shape="rect" id="node2" href="Shape_8h.html" title="Shape.h" alt="" coords="1116,80,1187,107"/><area shape="rect" id="node3" href="MapperGLCanvas_8h.html" title="MapperGLCanvas.h" alt="" coords="704,155,847,181"/><area shape="rect" id="node19" href="MappingGui_8h.html" title="MappingGui.h" alt="" coords="914,379,1018,405"/><area shape="rect" id="node24" href="ShapeGraphicsItem_8h.html" title="ShapeGraphicsItem.h" alt="" coords="1004,229,1155,256"/><area shape="rect" id="node27" href="Mapping_8h.html" title="Mapping.h" alt="" coords="1259,155,1342,181"/><area shape="rect" id="node33" href="Util_8h.html" title="Util.h" alt="" coords="1167,304,1218,331"/><area shape="rect" id="node35" href="Shape_8cpp.html" title="Shape.cpp" alt="" coords="1366,155,1451,181"/><area shape="rect" id="node4" href="SourceGLCanvas_8h.html" title="SourceGLCanvas.h" alt="" coords="897,528,1037,555"/><area shape="rect" id="node6" href="Commands_8h.html" title="Commands.h" alt="" coords="76,752,179,779"/><area shape="rect" id="node9" href="MapperGLCanvas_8cpp.html" title="MapperGLCanvas.cpp" alt="" coords="5,827,161,853"/><area shape="rect" id="node20" href="DestinationGLCanvas_8h.html" title="DestinationGLCanvas.h" alt="" coords="884,453,1048,480"/><area shape="rect" id="node25" href="ShapeControlPainter_8h.html" title="ShapeControlPainter.h" alt="" coords="697,304,853,331"/><area shape="rect" id="node5" href="MainWindow_8h.html" title="MainWindow.h" alt="" coords="804,677,915,704"/><area shape="rect" id="node18" href="SourceGLCanvas_8cpp.html" title="SourceGLCanvas.cpp" alt="" coords="934,752,1089,779"/><area shape="rect" id="node8" href="MainWindow_8cpp.html" title="MainWindow.cpp" alt="" coords="1117,827,1241,853"/><area shape="rect" id="node10" href="DestinationGLCanvas_8cpp.html" title="DestinationGLCanvas.cpp" alt="" coords="1113,752,1291,779"/><area shape="rect" id="node11" href="main_8cpp.html" title="main.cpp" alt="" coords="601,752,675,779"/><area shape="rect" id="node12" href="ProjectReader_8h.html" title="ProjectReader.h" alt="" coords="1556,752,1675,779"/><area shape="rect" id="node14" href="OutputGLCanvas_8cpp.html" title="OutputGLCanvas.cpp" alt="" coords="203,752,351,779"/><area shape="rect" id="node15" href="OutputGLWindow_8cpp.html" title="OutputGLWindow.cpp" alt="" coords="375,752,525,779"/><area shape="rect" id="node16" href="PreferencesDialog_8cpp.html" title="PreferencesDialog.cpp" alt="" coords="700,752,859,779"/><area shape="rect" id="node17" href="ShapeGraphicsItem_8cpp.html" title="ShapeGraphicsItem.cpp" alt="" coords="1316,752,1480,779"/><area shape="rect" id="node7" href="Commands_8cpp.html" title="Commands.cpp" alt="" coords="185,827,301,853"/><area shape="rect" id="node13" href="ProjectReader_8cpp.html" title="ProjectReader.cpp" alt="" coords="1549,827,1682,853"/><area shape="rect" id="node23" href="MappingGui_8cpp.html" title="MappingGui.cpp" alt="" coords="741,453,860,480"/><area shape="rect" id="node21" href="OutputGLCanvas_8h.html" title="OutputGLCanvas.h" alt="" coords="619,528,753,555"/><area shape="rect" id="node22" href="OutputGLWindow_8h.html" title="OutputGLWindow.h" alt="" coords="618,603,754,629"/><area shape="rect" id="node26" href="ShapeControlPainter_8cpp.html" title="ShapeControlPainter.cpp" alt="" coords="697,379,867,405"/><area shape="rect" id="node28" href="MappingManager_8h.html" title="MappingManager.h" alt="" coords="1307,379,1444,405"/><area shape="rect" id="node29" href="ProjectWriter_8h.html" title="ProjectWriter.h" alt="" coords="1463,453,1573,480"/><area shape="rect" id="node32" href="Mapping_8cpp.html" title="Mapping.cpp" alt="" coords="1281,229,1379,256"/><area shape="rect" id="node31" href="MappingManager_8cpp.html" title="MappingManager.cpp" alt="" coords="1288,453,1439,480"/><area shape="rect" id="node30" href="ProjectWriter_8cpp.html" title="ProjectWriter.cpp" alt="" coords="1555,528,1678,555"/><area shape="rect" id="node34" href="Util_8cpp.html" title="Util.cpp" alt="" coords="1218,379,1282,405"/></map>
</div>
</div>
<p><a href="Maths_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a9e87a5ff220750cda0fcd8fe65889caa"><td class="memItemLeft" align="right" valign="top">qreal </td><td class="memItemRight" valign="bottom"><a class="el" href="Maths_8h.html#a9e87a5ff220750cda0fcd8fe65889caa">degreesToRadians</a> (qreal degrees)</td></tr>
<tr class="memdesc:a9e87a5ff220750cda0fcd8fe65889caa"><td class="mdescLeft"> </td><td class="mdescRight">Converts from degrees to radians. <a href="#a9e87a5ff220750cda0fcd8fe65889caa">More...</a><br /></td></tr>
<tr class="separator:a9e87a5ff220750cda0fcd8fe65889caa"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae7f5dc16bb7c816ccaf596e0bdcfe161"><td class="memItemLeft" align="right" valign="top">qreal </td><td class="memItemRight" valign="bottom"><a class="el" href="Maths_8h.html#ae7f5dc16bb7c816ccaf596e0bdcfe161">radiansToDegrees</a> (qreal radians)</td></tr>
<tr class="memdesc:ae7f5dc16bb7c816ccaf596e0bdcfe161"><td class="mdescLeft"> </td><td class="mdescRight">Converts from radians to degrees. <a href="#ae7f5dc16bb7c816ccaf596e0bdcfe161">More...</a><br /></td></tr>
<tr class="separator:ae7f5dc16bb7c816ccaf596e0bdcfe161"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad33b94afdf38b2bed4a4035d6eac8ea5"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="Maths_8h.html#ad33b94afdf38b2bed4a4035d6eac8ea5">wrapAround</a> (int index, int max)</td></tr>
<tr class="memdesc:ad33b94afdf38b2bed4a4035d6eac8ea5"><td class="mdescLeft"> </td><td class="mdescRight">Wrap value around ie. wrapAround(-1, 3) ==> 2. <a href="#ad33b94afdf38b2bed4a4035d6eac8ea5">More...</a><br /></td></tr>
<tr class="separator:ad33b94afdf38b2bed4a4035d6eac8ea5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a89def7cb1ec18125de72c19940fc487d"><td class="memItemLeft" align="right" valign="top">qreal </td><td class="memItemRight" valign="bottom"><a class="el" href="Maths_8h.html#a89def7cb1ec18125de72c19940fc487d">sq</a> (qreal x)</td></tr>
<tr class="memdesc:a89def7cb1ec18125de72c19940fc487d"><td class="mdescLeft"> </td><td class="mdescRight">Square of x. <a href="#a89def7cb1ec18125de72c19940fc487d">More...</a><br /></td></tr>
<tr class="separator:a89def7cb1ec18125de72c19940fc487d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a81c5d8f6a146b74ad323c085565143e2"><td class="memItemLeft" align="right" valign="top">qreal </td><td class="memItemRight" valign="bottom"><a class="el" href="Maths_8h.html#a81c5d8f6a146b74ad323c085565143e2">distSq</a> (const QPointF &p1, const QPointF &p2)</td></tr>
<tr class="memdesc:a81c5d8f6a146b74ad323c085565143e2"><td class="mdescLeft"> </td><td class="mdescRight">Returns the squared euclidian distance between two points. <a href="#a81c5d8f6a146b74ad323c085565143e2">More...</a><br /></td></tr>
<tr class="separator:a81c5d8f6a146b74ad323c085565143e2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a165774ff5ff8c09b3a8f139395b33a91"><td class="memItemLeft" align="right" valign="top">qreal </td><td class="memItemRight" valign="bottom"><a class="el" href="Maths_8h.html#a165774ff5ff8c09b3a8f139395b33a91">dist</a> (const QPointF &p1, const QPointF &p2)</td></tr>
<tr class="memdesc:a165774ff5ff8c09b3a8f139395b33a91"><td class="mdescLeft"> </td><td class="mdescRight">Euclidian distance between two points. <a href="#a165774ff5ff8c09b3a8f139395b33a91">More...</a><br /></td></tr>
<tr class="separator:a165774ff5ff8c09b3a8f139395b33a91"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5e8854a0e0c55c065c58d2361a6d043b"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="Maths_8h.html#a5e8854a0e0c55c065c58d2361a6d043b">distIsInside</a> (const QPointF &p1, const QPointF &p2, qreal radius)</td></tr>
<tr class="memdesc:a5e8854a0e0c55c065c58d2361a6d043b"><td class="mdescLeft"> </td><td class="mdescRight">Returns true iff point #p1# is within distance #radius# of #p2# (using euclidian distance). <a href="#a5e8854a0e0c55c065c58d2361a6d043b">More...</a><br /></td></tr>
<tr class="separator:a5e8854a0e0c55c065c58d2361a6d043b"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a9e87a5ff220750cda0fcd8fe65889caa"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">qreal degreesToRadians </td>
<td>(</td>
<td class="paramtype">qreal </td>
<td class="paramname"><em>degrees</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Converts from degrees to radians. </p>
<p>Definition at line <a class="el" href="Maths_8h_source.html#l00029">29</a> of file <a class="el" href="Maths_8h_source.html">Maths.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> { <span class="keywordflow">return</span> degrees / 180.0f * M_PI; }</div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="ae7f5dc16bb7c816ccaf596e0bdcfe161"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">qreal radiansToDegrees </td>
<td>(</td>
<td class="paramtype">qreal </td>
<td class="paramname"><em>radians</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Converts from radians to degrees. </p>
<p>Definition at line <a class="el" href="Maths_8h_source.html#l00032">32</a> of file <a class="el" href="Maths_8h_source.html">Maths.h</a>.</p>
<p>Referenced by <a class="el" href="Shape_8h_source.html#l00305">Ellipse::getRotation()</a>.</p>
<div class="fragment"><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> { <span class="keywordflow">return</span> radians / M_PI * 180.0f; }</div>
</div><!-- fragment -->
<p><div id="dynsection-2" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
<img id="dynsection-2-trigger" src="closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-2-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-2-content" class="dyncontent" style="display:none;">
<div class="center"><img src="Maths_8h_ae7f5dc16bb7c816ccaf596e0bdcfe161_icgraph.png" border="0" usemap="#Maths_8h_ae7f5dc16bb7c816ccaf596e0bdcfe161_icgraph" alt=""/></div>
<map name="Maths_8h_ae7f5dc16bb7c816ccaf596e0bdcfe161_icgraph" id="Maths_8h_ae7f5dc16bb7c816ccaf596e0bdcfe161_icgraph">
<area shape="rect" id="node2" href="classEllipse.html#a41bb574712c32c3de25c7854ad60ad93" title="Ellipse::getRotation" alt="" coords="192,111,329,138"/><area shape="rect" id="node3" href="classEllipseControlPainter.html#a527e17b7b43f7bacb6ab4cee31d0e76c" title="EllipseControlPainter\l::_paintShape" alt="" coords="397,5,544,47"/><area shape="rect" id="node4" href="classEllipseColorGraphicsItem.html#a1e5f1f39a33c4824ef9b9bd530eb5628" title="EllipseColorGraphicsItem\l::shape" alt="" coords="384,71,557,112"/><area shape="rect" id="node6" href="classEllipseTextureGraphicsItem.html#a5a3ce56c292f77431d1ffc185a6c20ea" title="EllipseTextureGraphicsItem\l::shape" alt="" coords="377,136,564,177"/><area shape="rect" id="node8" href="namespaceUtil.html#a402d544da53b6fbee636acb6b9d2be1b" title="Util::drawControlsEllipse" alt="" coords="387,202,554,229"/><area shape="rect" id="node5" href="classEllipseColorGraphicsItem.html#ab666d63e62258aee71187f217774afec" title="Main paint function that needs to be overriden (called by paint()). " alt="" coords="619,71,792,112"/><area shape="rect" id="node7" href="classEllipseTextureGraphicsItem.html#a6d786821897bf8816022e9930a2047ef" title="Returns the bounding rectangle of this item. " alt="" coords="612,136,799,177"/></map>
</div>
</p>
</div>
</div>
<a class="anchor" id="ad33b94afdf38b2bed4a4035d6eac8ea5"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int wrapAround </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>index</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>max</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Wrap value around ie. wrapAround(-1, 3) ==> 2. </p>
<p>Definition at line <a class="el" href="Maths_8h_source.html#l00035">35</a> of file <a class="el" href="Maths_8h_source.html">Maths.h</a>.</p>
<p>Referenced by <a class="el" href="Shape_8cpp_source.html#l00050">Polygon::_constrainVertex()</a>.</p>
<div class="fragment"><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> { <span class="keywordflow">return</span> (index + max) % max; }</div>
</div><!-- fragment -->
<p><div id="dynsection-3" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
<img id="dynsection-3-trigger" src="closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-3-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-3-content" class="dyncontent" style="display:none;">
<div class="center"><img src="Maths_8h_ad33b94afdf38b2bed4a4035d6eac8ea5_icgraph.png" border="0" usemap="#Maths_8h_ad33b94afdf38b2bed4a4035d6eac8ea5_icgraph" alt=""/></div>
<map name="Maths_8h_ad33b94afdf38b2bed4a4035d6eac8ea5_icgraph" id="Maths_8h_ad33b94afdf38b2bed4a4035d6eac8ea5_icgraph">
<area shape="rect" id="node2" href="classPolygon.html#ac477fb214a0de13fbf34eef6725c6572" title="Makes sure vertex v as the i-th point of polygon stays inside the polygon. " alt="" coords="148,31,328,57"/><area shape="rect" id="node3" href="classPolygon.html#a4f720fa6f6b9f3c10f40b397b06f125a" title="Polygon::setVertex" alt="" coords="376,5,513,32"/><area shape="rect" id="node4" href="classMesh.html#aad7c33e24067bdaf002f7c48dd616002" title="Mesh::setVertex" alt="" coords="385,56,505,83"/></map>
</div>
</p>
</div>
</div>
<a class="anchor" id="a89def7cb1ec18125de72c19940fc487d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">qreal sq </td>
<td>(</td>
<td class="paramtype">qreal </td>
<td class="paramname"><em>x</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Square of x. </p>
<p>Definition at line <a class="el" href="Maths_8h_source.html#l00038">38</a> of file <a class="el" href="Maths_8h_source.html">Maths.h</a>.</p>
<p>Referenced by <a class="el" href="Maths_8h_source.html#l00054">distIsInside()</a>, <a class="el" href="Maths_8h_source.html#l00044">distSq()</a>, and <a class="el" href="MapperGLCanvas_8cpp_source.html#l00103">MapperGLCanvas::mousePressEvent()</a>.</p>
<div class="fragment"><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> { <span class="keywordflow">return</span> x*x; }</div>
</div><!-- fragment -->
<p><div id="dynsection-4" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
<img id="dynsection-4-trigger" src="closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-4-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-4-content" class="dyncontent" style="display:none;">
<div class="center"><img src="Maths_8h_a89def7cb1ec18125de72c19940fc487d_icgraph.png" border="0" usemap="#Maths_8h_a89def7cb1ec18125de72c19940fc487d_icgraph" alt=""/></div>
<map name="Maths_8h_a89def7cb1ec18125de72c19940fc487d_icgraph" id="Maths_8h_a89def7cb1ec18125de72c19940fc487d_icgraph">
<area shape="rect" id="node2" href="Maths_8h.html#a5e8854a0e0c55c065c58d2361a6d043b" title="Returns true iff point #p1# is within distance #radius# of #p2# (using euclidian distance). " alt="" coords="200,46,289,73"/><area shape="rect" id="node7" href="Maths_8h.html#a81c5d8f6a146b74ad323c085565143e2" title="Returns the squared euclidian distance between two points. " alt="" coords="92,97,152,123"/><area shape="rect" id="node8" href="classMapperGLCanvas.html#ab52fae5217c3d97ebcaa4a5099eb9053" title="MapperGLCanvas::mousePress\lEvent" alt="" coords="337,140,553,181"/><area shape="rect" id="node3" href="classMapperGLCanvas.html#a135b9b4b298bd1106b145f44bb4babbe" title="MapperGLCanvas::_glueVertex" alt="" coords="339,46,551,73"/><area shape="rect" id="node4" href="classMapperGLCanvas.html#a2741ecbd52014c1f657732a6ee917135" title="MapperGLCanvas::mouseRelease\lEvent" alt="" coords="601,5,833,47"/><area shape="rect" id="node5" href="classMapperGLCanvas.html#a0fc8394d1d84870f6e2f1fabdf7c7d85" title="MapperGLCanvas::mouseMove\lEvent" alt="" coords="610,71,825,112"/><area shape="rect" id="node6" href="classOutputGLCanvas.html#a7f96e84fdabf74506cbb5f5c94cc3f4a" title="OutputGLCanvas::mouseMove\lEvent" alt="" coords="881,71,1088,112"/><area shape="rect" id="node9" href="Maths_8h.html#a165774ff5ff8c09b3a8f139395b33a91" title="Euclidian distance between two points. " alt="" coords="223,147,266,174"/></map>
</div>
</p>
</div>
</div>
<a class="anchor" id="a81c5d8f6a146b74ad323c085565143e2"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">qreal distSq </td>
<td>(</td>
<td class="paramtype">const QPointF & </td>
<td class="paramname"><em>p1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const QPointF & </td>
<td class="paramname"><em>p2</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the squared euclidian distance between two points. </p>
<p>This can be used rather than <a class="el" href="Maths_8h.html#a165774ff5ff8c09b3a8f139395b33a91" title="Euclidian distance between two points. ">dist()</a> to compute the distance faster (prevents the sqrt() computation). </p>
<p>Definition at line <a class="el" href="Maths_8h_source.html#l00044">44</a> of file <a class="el" href="Maths_8h_source.html">Maths.h</a>.</p>
<p>References <a class="el" href="Maths_8h_source.html#l00038">sq()</a>.</p>
<p>Referenced by <a class="el" href="Maths_8h_source.html#l00049">dist()</a>, <a class="el" href="Maths_8h_source.html#l00054">distIsInside()</a>, and <a class="el" href="MapperGLCanvas_8cpp_source.html#l00103">MapperGLCanvas::mousePressEvent()</a>.</p>
<div class="fragment"><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  {</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <span class="keywordflow">return</span> <a class="code" href="Maths_8h.html#a89def7cb1ec18125de72c19940fc487d">sq</a>(p1.x() - p2.x()) + <a class="code" href="Maths_8h.html#a89def7cb1ec18125de72c19940fc487d">sq</a>(p1.y() - p2.y());</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span> }</div>
<div class="ttc" id="Maths_8h_html_a89def7cb1ec18125de72c19940fc487d"><div class="ttname"><a href="Maths_8h.html#a89def7cb1ec18125de72c19940fc487d">sq</a></div><div class="ttdeci">qreal sq(qreal x)</div><div class="ttdoc">Square of x. </div><div class="ttdef"><b>Definition:</b> <a href="Maths_8h_source.html#l00038">Maths.h:38</a></div></div>
</div><!-- fragment -->
<p><div id="dynsection-5" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
<img id="dynsection-5-trigger" src="closed.png" alt="+"/> Here is the call graph for this function:</div>
<div id="dynsection-5-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-5-content" class="dyncontent" style="display:none;">
<div class="center"><img src="Maths_8h_a81c5d8f6a146b74ad323c085565143e2_cgraph.png" border="0" usemap="#Maths_8h_a81c5d8f6a146b74ad323c085565143e2_cgraph" alt=""/></div>
<map name="Maths_8h_a81c5d8f6a146b74ad323c085565143e2_cgraph" id="Maths_8h_a81c5d8f6a146b74ad323c085565143e2_cgraph">
<area shape="rect" id="node2" href="Maths_8h.html#a89def7cb1ec18125de72c19940fc487d" title="Square of x. " alt="" coords="113,5,152,32"/></map>
</div>
</p>
<p><div id="dynsection-6" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
<img id="dynsection-6-trigger" src="closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-6-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-6-content" class="dyncontent" style="display:none;">
<div class="center"><img src="Maths_8h_a81c5d8f6a146b74ad323c085565143e2_icgraph.png" border="0" usemap="#Maths_8h_a81c5d8f6a146b74ad323c085565143e2_icgraph" alt=""/></div>
<map name="Maths_8h_a81c5d8f6a146b74ad323c085565143e2_icgraph" id="Maths_8h_a81c5d8f6a146b74ad323c085565143e2_icgraph">
<area shape="rect" id="node2" href="Maths_8h.html#a165774ff5ff8c09b3a8f139395b33a91" title="Euclidian distance between two points. " alt="" coords="137,5,179,32"/><area shape="rect" id="node3" href="classMapperGLCanvas.html#ab52fae5217c3d97ebcaa4a5099eb9053" title="MapperGLCanvas::mousePress\lEvent" alt="" coords="251,19,467,61"/><area shape="rect" id="node4" href="Maths_8h.html#a5e8854a0e0c55c065c58d2361a6d043b" title="Returns true iff point #p1# is within distance #radius# of #p2# (using euclidian distance). " alt="" coords="113,107,203,133"/><area shape="rect" id="node5" href="classMapperGLCanvas.html#a135b9b4b298bd1106b145f44bb4babbe" title="MapperGLCanvas::_glueVertex" alt="" coords="253,107,465,133"/><area shape="rect" id="node6" href="classMapperGLCanvas.html#a2741ecbd52014c1f657732a6ee917135" title="MapperGLCanvas::mouseRelease\lEvent" alt="" coords="515,66,747,107"/><area shape="rect" id="node7" href="classMapperGLCanvas.html#a0fc8394d1d84870f6e2f1fabdf7c7d85" title="MapperGLCanvas::mouseMove\lEvent" alt="" coords="523,131,738,173"/><area shape="rect" id="node8" href="classOutputGLCanvas.html#a7f96e84fdabf74506cbb5f5c94cc3f4a" title="OutputGLCanvas::mouseMove\lEvent" alt="" coords="795,131,1001,173"/></map>
</div>
</p>
</div>
</div>
<a class="anchor" id="a165774ff5ff8c09b3a8f139395b33a91"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">qreal dist </td>
<td>(</td>
<td class="paramtype">const QPointF & </td>
<td class="paramname"><em>p1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const QPointF & </td>
<td class="paramname"><em>p2</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Euclidian distance between two points. </p>
<p>Definition at line <a class="el" href="Maths_8h_source.html#l00049">49</a> of file <a class="el" href="Maths_8h_source.html">Maths.h</a>.</p>
<p>References <a class="el" href="Maths_8h_source.html#l00044">distSq()</a>.</p>
<p>Referenced by <a class="el" href="MapperGLCanvas_8cpp_source.html#l00103">MapperGLCanvas::mousePressEvent()</a>.</p>
<div class="fragment"><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  {</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <span class="keywordflow">return</span> sqrt( <a class="code" href="Maths_8h.html#a81c5d8f6a146b74ad323c085565143e2">distSq</a>(p1, p2) );</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> }</div>
<div class="ttc" id="Maths_8h_html_a81c5d8f6a146b74ad323c085565143e2"><div class="ttname"><a href="Maths_8h.html#a81c5d8f6a146b74ad323c085565143e2">distSq</a></div><div class="ttdeci">qreal distSq(const QPointF &p1, const QPointF &p2)</div><div class="ttdoc">Returns the squared euclidian distance between two points. </div><div class="ttdef"><b>Definition:</b> <a href="Maths_8h_source.html#l00044">Maths.h:44</a></div></div>
</div><!-- fragment -->
<p><div id="dynsection-7" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
<img id="dynsection-7-trigger" src="closed.png" alt="+"/> Here is the call graph for this function:</div>
<div id="dynsection-7-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-7-content" class="dyncontent" style="display:none;">
<div class="center"><img src="Maths_8h_a165774ff5ff8c09b3a8f139395b33a91_cgraph.png" border="0" usemap="#Maths_8h_a165774ff5ff8c09b3a8f139395b33a91_cgraph" alt=""/></div>
<map name="Maths_8h_a165774ff5ff8c09b3a8f139395b33a91_cgraph" id="Maths_8h_a165774ff5ff8c09b3a8f139395b33a91_cgraph">
<area shape="rect" id="node2" href="Maths_8h.html#a81c5d8f6a146b74ad323c085565143e2" title="Returns the squared euclidian distance between two points. " alt="" coords="96,5,156,32"/><area shape="rect" id="node3" href="Maths_8h.html#a89def7cb1ec18125de72c19940fc487d" title="Square of x. " alt="" coords="204,5,243,32"/></map>
</div>
</p>
<p><div id="dynsection-8" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
<img id="dynsection-8-trigger" src="closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-8-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-8-content" class="dyncontent" style="display:none;">
<div class="center"><img src="Maths_8h_a165774ff5ff8c09b3a8f139395b33a91_icgraph.png" border="0" usemap="#Maths_8h_a165774ff5ff8c09b3a8f139395b33a91_icgraph" alt=""/></div>
<map name="Maths_8h_a165774ff5ff8c09b3a8f139395b33a91_icgraph" id="Maths_8h_a165774ff5ff8c09b3a8f139395b33a91_icgraph">
<area shape="rect" id="node2" href="classMapperGLCanvas.html#ab52fae5217c3d97ebcaa4a5099eb9053" title="MapperGLCanvas::mousePress\lEvent" alt="" coords="96,5,312,47"/></map>
</div>
</p>
</div>
</div>
<a class="anchor" id="a5e8854a0e0c55c065c58d2361a6d043b"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool distIsInside </td>
<td>(</td>
<td class="paramtype">const QPointF & </td>
<td class="paramname"><em>p1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const QPointF & </td>
<td class="paramname"><em>p2</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">qreal </td>
<td class="paramname"><em>radius</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns true iff point #p1# is within distance #radius# of #p2# (using euclidian distance). </p>
<p>Definition at line <a class="el" href="Maths_8h_source.html#l00054">54</a> of file <a class="el" href="Maths_8h_source.html">Maths.h</a>.</p>
<p>References <a class="el" href="Maths_8h_source.html#l00044">distSq()</a>, and <a class="el" href="Maths_8h_source.html#l00038">sq()</a>.</p>
<p>Referenced by <a class="el" href="MapperGLCanvas_8cpp_source.html#l00521">MapperGLCanvas::_glueVertex()</a>.</p>
<div class="fragment"><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  {</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  <span class="keywordflow">return</span> <a class="code" href="Maths_8h.html#a81c5d8f6a146b74ad323c085565143e2">distSq</a>(p1, p2) < <a class="code" href="Maths_8h.html#a89def7cb1ec18125de72c19940fc487d">sq</a>(radius);</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span> }</div>
<div class="ttc" id="Maths_8h_html_a89def7cb1ec18125de72c19940fc487d"><div class="ttname"><a href="Maths_8h.html#a89def7cb1ec18125de72c19940fc487d">sq</a></div><div class="ttdeci">qreal sq(qreal x)</div><div class="ttdoc">Square of x. </div><div class="ttdef"><b>Definition:</b> <a href="Maths_8h_source.html#l00038">Maths.h:38</a></div></div>
<div class="ttc" id="Maths_8h_html_a81c5d8f6a146b74ad323c085565143e2"><div class="ttname"><a href="Maths_8h.html#a81c5d8f6a146b74ad323c085565143e2">distSq</a></div><div class="ttdeci">qreal distSq(const QPointF &p1, const QPointF &p2)</div><div class="ttdoc">Returns the squared euclidian distance between two points. </div><div class="ttdef"><b>Definition:</b> <a href="Maths_8h_source.html#l00044">Maths.h:44</a></div></div>
</div><!-- fragment -->
<p><div id="dynsection-9" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
<img id="dynsection-9-trigger" src="closed.png" alt="+"/> Here is the call graph for this function:</div>
<div id="dynsection-9-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-9-content" class="dyncontent" style="display:none;">
<div class="center"><img src="Maths_8h_a5e8854a0e0c55c065c58d2361a6d043b_cgraph.png" border="0" usemap="#Maths_8h_a5e8854a0e0c55c065c58d2361a6d043b_cgraph" alt=""/></div>
<map name="Maths_8h_a5e8854a0e0c55c065c58d2361a6d043b_cgraph" id="Maths_8h_a5e8854a0e0c55c065c58d2361a6d043b_cgraph">
<area shape="rect" id="node2" href="Maths_8h.html#a81c5d8f6a146b74ad323c085565143e2" title="Returns the squared euclidian distance between two points. " alt="" coords="143,5,203,32"/><area shape="rect" id="node3" href="Maths_8h.html#a89def7cb1ec18125de72c19940fc487d" title="Square of x. " alt="" coords="251,31,289,57"/></map>
</div>
</p>
<p><div id="dynsection-10" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
<img id="dynsection-10-trigger" src="closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-10-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-10-content" class="dyncontent" style="display:none;">
<div class="center"><img src="Maths_8h_a5e8854a0e0c55c065c58d2361a6d043b_icgraph.png" border="0" usemap="#Maths_8h_a5e8854a0e0c55c065c58d2361a6d043b_icgraph" alt=""/></div>
<map name="Maths_8h_a5e8854a0e0c55c065c58d2361a6d043b_icgraph" id="Maths_8h_a5e8854a0e0c55c065c58d2361a6d043b_icgraph">
<area shape="rect" id="node2" href="classMapperGLCanvas.html#a135b9b4b298bd1106b145f44bb4babbe" title="MapperGLCanvas::_glueVertex" alt="" coords="143,46,355,73"/><area shape="rect" id="node3" href="classMapperGLCanvas.html#a2741ecbd52014c1f657732a6ee917135" title="MapperGLCanvas::mouseRelease\lEvent" alt="" coords="403,5,635,47"/><area shape="rect" id="node4" href="classMapperGLCanvas.html#a0fc8394d1d84870f6e2f1fabdf7c7d85" title="MapperGLCanvas::mouseMove\lEvent" alt="" coords="411,71,626,112"/><area shape="rect" id="node5" href="classOutputGLCanvas.html#a7f96e84fdabf74506cbb5f5c94cc3f4a" title="OutputGLCanvas::mouseMove\lEvent" alt="" coords="683,71,889,112"/></map>
</div>
</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Jan 8 2016 09:37:01 for MapMap by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.8
</small></address>
</body>
</html>