1#ifndef LIBSBX_MATH_VECTOR2_HPP_
2#define LIBSBX_MATH_VECTOR2_HPP_
12#include <yaml-cpp/yaml.h>
14#include <fmt/format.h>
16#include <libsbx/math/concepts.hpp>
17#include <libsbx/math/vector.hpp>
31 inline static constexpr auto x_axis = std::size_t{0u};
32 inline static constexpr auto y_axis = std::size_t{1u};
36 using value_type = base_type::value_type;
37 using reference = base_type::reference;
38 using const_reference = base_type::const_reference;
39 using size_type = base_type::size_type;
40 using length_type = base_type::length_type;
42 inline static constexpr basic_vector2 zero{base_type::fill(value_type{0})};
43 inline static constexpr basic_vector2 one{base_type::fill(value_type{1})};
45 using base_type::base_type;
49 template<scalar Other>
62 [[nodiscard]]
constexpr auto x()
noexcept -> reference;
64 [[nodiscard]]
constexpr auto x()
const noexcept -> const_reference;
66 [[nodiscard]]
constexpr auto y()
noexcept -> reference;
68 [[nodiscard]]
constexpr auto y()
const noexcept -> const_reference;
72template<scalar Lhs, scalar Rhs>
75template<scalar Lhs, scalar Rhs>
81template<scalar Lhs, scalar Rhs>
84template<scalar Lhs, scalar Rhs>
87template<scalar Lhs, scalar Rhs>
90template<scalar Lhs, scalar Rhs>
103template<sbx::math::scalar Type>
104struct std::hash<sbx::math::basic_vector2<Type>> {
110template<sbx::math::scalar Type>
111struct YAML::convert<sbx::math::basic_vector2<Type>> {
119template<sbx::math::scalar Type>
120struct fmt::formatter<sbx::math::basic_vector2<Type>> {
122 template<
typename ParseContext>
123 constexpr auto parse(ParseContext& context) ->
decltype(context.begin());
125 template<
typename FormatContext>
130#include <libsbx/math/vector2.ipp>
A vector in two-dimensional space.
Definition: vector2.hpp:27
Definition: vector.hpp:19