MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
BasisMatrices.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <Eigen/Dense>
4
5namespace MayaFlux::Kinesis {
6
8 static inline const Eigen::Matrix4d CATMULL_ROM_BASE {
9 { -0.5, 1.5, -1.5, 0.5 },
10 { 1.0, -2.5, 2.0, -0.5 },
11 { -0.5, 0.0, 0.5, 0.0 },
12 { 0.0, 1.0, 0.0, 0.0 }
13 };
14
15 static inline const Eigen::Matrix4d CUBIC_BEZIER {
16 { -1.0, 3.0, -3.0, 1.0 },
17 { 3.0, -6.0, 3.0, 0.0 },
18 { -3.0, 3.0, 0.0, 0.0 },
19 { 1.0, 0.0, 0.0, 0.0 }
20 };
21
22 static inline const Eigen::Matrix3d QUADRATIC_BEZIER {
23 { 1.0, -2.0, 1.0 },
24 { -2.0, 2.0, 0.0 },
25 { 1.0, 0.0, 0.0 }
26 };
27
28 static inline const Eigen::Matrix4d BSPLINE_CUBIC {
29 { -1.0 / 6.0, 3.0 / 6.0, -3.0 / 6.0, 1.0 / 6.0 },
30 { 3.0 / 6.0, -6.0 / 6.0, 3.0 / 6.0, 0.0 },
31 { -3.0 / 6.0, 0.0, 3.0 / 6.0, 0.0 },
32 { 1.0 / 6.0, 4.0 / 6.0, 1.0 / 6.0, 0.0 }
33 };
34
35 static Eigen::Matrix4d catmull_rom_with_tension(double tension)
36 {
37 Eigen::Matrix4d m;
38 m << -tension, 2.0 - tension, tension - 2.0, tension,
39 2.0 * tension, tension - 3.0, 3.0 - 2.0 * tension, -tension,
40 -tension, 0.0, tension, 0.0,
41 0.0, 1.0, 0.0, 0.0;
42 return m;
43 }
44};
45
46} // namespace MayaFlux::Kinesis
static const Eigen::Matrix4d CATMULL_ROM_BASE
static const Eigen::Matrix4d BSPLINE_CUBIC
static const Eigen::Matrix3d QUADRATIC_BEZIER
static Eigen::Matrix4d catmull_rom_with_tension(double tension)
static const Eigen::Matrix4d CUBIC_BEZIER