1#ifndef LIBSBX_MATH_MATRIX3X3_HPP_
2#define LIBSBX_MATH_MATRIX3X3_HPP_
13#include <fmt/format.h>
15#include <libsbx/math/concepts.hpp>
16#include <libsbx/math/vector3.hpp>
17#include <libsbx/math/vector4.hpp>
18#include <libsbx/math/matrix.hpp>
19#include <libsbx/math/angle.hpp>
28 template<scalar Other>
31 inline static constexpr auto x_axis = std::size_t{0u};
32 inline static constexpr auto y_axis = std::size_t{1u};
33 inline static constexpr auto z_axis = std::size_t{2u};
37 using value_type = base_type::value_type;
38 using reference = base_type::reference;
39 using const_reference = base_type::const_reference;
40 using size_type = base_type::size_type;
43 inline static constexpr basic_matrix3x3 identity{base_type::identity()};
47 using base_type::base_type;
51 template<scalar Other>
58 template<scalar Other>
60 Other x0, Other x1, Other x2,
61 Other y0, Other y1, Other y2,
62 Other z0, Other z1, Other z2
65 template<scalar Other>
66 constexpr basic_matrix3x3(
const Other v00,
const Other v11,
const Other v22)
noexcept;
84 constexpr auto operator[](size_type index)
const noexcept ->
const column_type&;
86 constexpr auto operator[](size_type index)
noexcept ->
column_type&;
99template<scalar Lhs, scalar Rhs>
116template<sbx::math::scalar Type>
117struct fmt::formatter<sbx::math::basic_matrix3x3<Type>> {
119 template<
typename ParseContext>
120 constexpr auto parse(ParseContext& context) ->
decltype(context.begin()) {
121 return context.begin();
124 template<
typename FormatContext>
126 if constexpr (sbx::math::is_floating_point_v<Type>) {
127 return fmt::format_to(context.out(),
128 "\n{:.2f}, {:.2f}, {:.2f}\n{:.2f}, {:.2f}, {:.2f}\n{:.2f}, {:.2f}, {:.2f}\n{:.2f}, {:.2f}, {:.2f}",
129 matrix[0][0], matrix[1][0], matrix[2][0],
130 matrix[0][1], matrix[1][1], matrix[2][1],
131 matrix[0][2], matrix[1][2], matrix[2][2]
134 return fmt::format_to(context.out(),
135 "\n{}, {}, {}\n{}, {}, {}\n{}, {}, {}\n{}, {}, {}",
136 matrix[0][0], matrix[1][0], matrix[2][0],
137 matrix[0][1], matrix[1][1], matrix[2][1],
138 matrix[0][2], matrix[1][2], matrix[2][2]
145#include <libsbx/math/matrix3x3.ipp>
Definition: matrix3x3.hpp:24
Definition: matrix.hpp:13
Definition: vector3.hpp:22