Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
5edab25c
Commit
5edab25c
authored
May 24, 2018
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added angle_between_lines()
parent
ec150f8d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
line.h
dlib/geometry/line.h
+12
-0
line_abstract.h
dlib/geometry/line_abstract.h
+12
-0
No files found.
dlib/geometry/line.h
View file @
5edab25c
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
#include "line_abstract.h"
#include "line_abstract.h"
#include "vector.h"
#include "vector.h"
#include <utility>
#include <utility>
#include "../numeric_constants.h"
namespace
dlib
namespace
dlib
{
{
...
@@ -172,6 +173,17 @@ namespace dlib
...
@@ -172,6 +173,17 @@ namespace dlib
return
cnt
;
return
cnt
;
}
}
// ----------------------------------------------------------------------------------------
inline
double
angle_between_lines
(
const
line
&
a
,
const
line
&
b
)
{
auto
tmp
=
put_in_range
(
0
.
0
,
1
.
0
,
std
::
abs
(
dot
(
a
.
normal
(),
b
.
normal
())));
return
std
::
acos
(
tmp
)
*
180
/
pi
;
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
}
}
...
...
dlib/geometry/line_abstract.h
View file @
5edab25c
...
@@ -145,6 +145,18 @@ namespace dlib
...
@@ -145,6 +145,18 @@ namespace dlib
exists then this function returns a point with Inf values in it.
exists then this function returns a point with Inf values in it.
!*/
!*/
// ----------------------------------------------------------------------------------------
double
angle_between_lines
(
const
line
&
a
,
const
line
&
b
);
/*!
ensures
- returns the angle, in degrees, between the given lines. This is a number in
the range [0 90].
!*/
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
template
<
typename
T
>
template
<
typename
T
>
...
...
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