Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Philip Trettner
typed-geometry
Commits
a3b7af6d
Commit
a3b7af6d
authored
Aug 27, 2019
by
Philip Trettner
Browse files
matrix add for quadrics
parent
f818ef4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/typed-geometry/types/quadric.hh
View file @
a3b7af6d
...
...
@@ -177,6 +177,22 @@ public:
d_sqr
+=
rhs
.
d_sqr
;
}
// adds a quadric given in matrix form (x^T A x + b^T x + c)
// optionally with a c value
void
add
(
mat
<
3
,
3
,
scalar_t
>
const
&
A
,
vec
<
3
,
scalar_t
>
const
&
b
,
scalar_t
c
=
{})
{
A00
+=
A
[
0
][
0
];
A01
+=
A
[
0
][
1
];
A02
+=
A
[
0
][
2
];
A11
+=
A
[
1
][
1
];
A12
+=
A
[
1
][
2
];
A22
+=
A
[
2
][
2
];
r
+=
b
;
d_sqr
+=
c
;
}
// TODO: fix me
template
<
class
T
>
friend
constexpr
T
distance_sqr
(
pos
<
3
,
T
>
const
&
p
,
quadric
<
3
,
T
>
const
&
q
);
...
...
Write
Preview
Supports
Markdown
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