Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
typed-geometry
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
8
Issues
8
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Philip Trettner
typed-geometry
Commits
afa57ab9
Commit
afa57ab9
authored
Mar 30, 2020
by
Julius NehringWirxel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed are_orthogonal for real.
parent
69649b8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
src/typed-geometry/functions/tests/vec_tests.hh
src/typed-geometry/functions/tests/vec_tests.hh
+3
-1
No files found.
src/typed-geometry/functions/tests/vec_tests.hh
View file @
afa57ab9
...
...
@@ -32,7 +32,9 @@ template <int D, class ScalarT, class = enable_if<is_floating_point<ScalarT>>>
template
<
int
D
,
class
ScalarT
>
[[
nodiscard
]]
constexpr
bool
are_orthogonal
(
vec
<
D
,
ScalarT
>
const
&
a
,
vec
<
D
,
ScalarT
>
const
&
b
,
ScalarT
eps
=
100
*
D
*
tg
::
epsilon
<
ScalarT
>
)
{
return
abs
(
dot
(
a
,
b
))
<
max
(
max_element
(
abs
(
a
)),
max_element
(
abs
(
b
)))
*
eps
;
// the error scales with the square of the magnitude of the inputs
auto
const
scale
=
max
(
max_element
(
abs
(
a
)),
max_element
(
abs
(
b
)));
return
abs
(
dot
(
a
,
b
))
<
scale
*
scale
*
eps
;
}
template
<
int
D
,
class
ScalarT
>
...
...
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