Skip to content

Commit 1ec4c1b

Browse files
committed
function skew moved to geometry
1 parent fb4b5a2 commit 1ec4c1b

File tree

7 files changed

+48
-15
lines changed

7 files changed

+48
-15
lines changed

src/geometry/conics.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "qassert.h"
3232
#include "qlogging.h"
3333

34-
#include "matfun.h"
34+
#include "geometry/skew.h"
3535

3636

3737
//! conics, rotations, bounding boxes, cross product
@@ -42,8 +42,6 @@ using Eigen::Vector3d;
4242
using Eigen::Matrix2d;
4343
using Eigen::Vector2d;
4444

45-
using Matfun::skew;
46-
4745

4846
//! Base class for conics
4947
class ConicBase

src/geometry/skew.h

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* This file is part of the GreasePad distribution (https://github.com/FraunhoferIOSB/GreasePad).
3+
* Copyright (c) 2022-2026 Jochen Meidow, Fraunhofer IOSB
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*/
18+
19+
20+
#ifndef SKEW_H
21+
#define SKEW_H
22+
23+
24+
#include <Eigen/Core>
25+
26+
namespace Geometry {
27+
28+
//! skew-symmetric matrix S(x) from vector x
29+
template <typename T>
30+
[[maybe_unused]] inline static Eigen::Matrix<T,3,3> skew(const Eigen::Vector<T,3> &x)
31+
{
32+
return (Eigen::Matrix<T,3,3>() << 0.,-x(2),x(1), x(2),0.,-x(0), -x(1),x(0),0.).finished();
33+
}
34+
35+
} // namespace Geometry
36+
37+
#endif // SKEW_H

src/greasepad.pro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ HEADERS += \
5353
geometry/aabb.h \
5454
geometry/conics.h \
5555
geometry/minrot.h \
56+
geometry/skew.h \
5657
global.h \
5758
mainwindow.h \
5859
mainscene.h \

src/matfun.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,6 @@ using Eigen::Dynamic;
7777
}
7878

7979

80-
//! skew-symmetric matrix S(x) from vector x
81-
template <typename T>
82-
[[maybe_unused]] static Matrix<T,3,3> skew(const Vector<T,3> &x)
83-
{
84-
return (Matrix<T,3,3>() << 0.,-x(2),x(1), x(2),0.,-x(0), -x(1),x(0),0.).finished();
85-
}
86-
87-
8880
//! 3x3 cofactor matrix, i.e., transposed adjugate
8981
[[maybe_unused]] static Matrix3d cof3(const Matrix3d &MM)
9082
{

src/uncertain.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,16 @@
2626
#include <cmath>
2727
#include <utility>
2828

29-
#include "matfun.h"
29+
#include "geometry/skew.h"
3030

3131

3232
//! Uncertain geometric entities
3333
namespace Uncertain {
3434

3535
using Eigen::Matrix3d;
3636
using Eigen::Vector3d;
37-
using Matfun::skew;
37+
38+
using Geometry::skew;
3839

3940

4041
//! Check if matrix is covariance matrix

src/upoint.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818

1919

20+
#include "matfun.h"
2021
#include "uncertain.h"
2122
#include "upoint.h"
2223
#include "ustraightline.h"

src/usegment.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* This file is part of the GreasePad distribution (https://github.com/FraunhoferIOSB/GreasePad).
3-
* Copyright (c) 2022-2025 Jochen Meidow, Fraunhofer IOSB
3+
* Copyright (c) 2022-2026 Jochen Meidow, Fraunhofer IOSB
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -16,9 +16,11 @@
1616
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1717
*/
1818

19-
#include "usegment.h"
19+
20+
#include "matfun.h"
2021
#include "uncertain.h"
2122
#include "upoint.h"
23+
#include "usegment.h"
2224
#include "ustraightline.h"
2325

2426
#include <Eigen/Core>
@@ -41,6 +43,7 @@ using Eigen::VectorXd;
4143

4244
using Matfun::sign;
4345

46+
4447
namespace Uncertain {
4548

4649
// class uPoint;

0 commit comments

Comments
 (0)