Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
66fcb84f
Commit
66fcb84f
authored
Mar 12, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor fix to SEG class.
parent
d2ed2efc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
seg.h
include/geometry/seg.h
+9
-9
No files found.
include/geometry/seg.h
View file @
66fcb84f
...
@@ -46,7 +46,8 @@ public:
...
@@ -46,7 +46,8 @@ public:
* to an object the segment belongs to (e.g. a line chain) or references to locally stored
* to an object the segment belongs to (e.g. a line chain) or references to locally stored
* points (m_a, m_b).
* points (m_a, m_b).
*/
*/
VECTOR2I
&
A
,
B
;
VECTOR2I
&
A
;
VECTOR2I
&
B
;
/** Default constructor
/** Default constructor
* Creates an empty (0, 0) segment, locally-referenced
* Creates an empty (0, 0) segment, locally-referenced
...
@@ -203,6 +204,8 @@ public:
...
@@ -203,6 +204,8 @@ public:
bool
Collide
(
const
SEG
&
aSeg
,
int
aClearance
)
const
;
bool
Collide
(
const
SEG
&
aSeg
,
int
aClearance
)
const
;
ecoord
SquaredDistance
(
const
SEG
&
aSeg
)
const
;
/**
/**
* Function Distance()
* Function Distance()
*
*
...
@@ -210,14 +213,16 @@ public:
...
@@ -210,14 +213,16 @@ public:
* @param aSeg other segment
* @param aSeg other segment
* @return minimum distance
* @return minimum distance
*/
*/
ecoord
SquaredDistance
(
const
SEG
&
aSeg
)
const
;
int
Distance
(
const
SEG
&
aSeg
)
const
int
Distance
(
const
SEG
&
aSeg
)
const
{
{
return
sqrt
(
SquaredDistance
(
aSeg
)
);
return
sqrt
(
SquaredDistance
(
aSeg
)
);
}
}
ecoord
SquaredDistance
(
const
VECTOR2I
&
aP
)
const
{
return
(
NearestPoint
(
aP
)
-
aP
).
SquaredEuclideanNorm
();
}
/**
/**
* Function Distance()
* Function Distance()
*
*
...
@@ -225,11 +230,6 @@ public:
...
@@ -225,11 +230,6 @@ public:
* @param aP the point
* @param aP the point
* @return minimum distance
* @return minimum distance
*/
*/
ecoord
SquaredDistance
(
const
VECTOR2I
&
aP
)
const
{
return
(
NearestPoint
(
aP
)
-
aP
).
SquaredEuclideanNorm
();
}
int
Distance
(
const
VECTOR2I
&
aP
)
const
int
Distance
(
const
VECTOR2I
&
aP
)
const
{
{
return
sqrt
(
SquaredDistance
(
aP
)
);
return
sqrt
(
SquaredDistance
(
aP
)
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment