5#include "ll/api/base/Macro.h"
7#include "mc/math/vector/base/Field.h"
8#include "mc/math/vector/base/VectorBase.h"
14template <
typename T,
typename... Components>
17 using first_type =
Field<T, Components...>::first_type;
19 [[nodiscard]]
constexpr T cross(T
const& b)
const noexcept
20 requires(IntN::size() == 3)
23 static_cast<T const*
>(
this)->
template get<first_type, 1>() * b.template get<first_type, 2>()
24 -
static_cast<T const*
>(
this)->
template get<first_type, 2>() * b.template get<first_type, 1>(),
25 static_cast<T const*
>(
this)->
template get<first_type, 2>() * b.template get<first_type, 0>()
26 -
static_cast<T const*
>(
this)->
template get<first_type, 0>() * b.template get<first_type, 2>(),
27 static_cast<T const*
>(
this)->
template get<first_type, 0>() * b.template get<first_type, 1>()
28 -
static_cast<T const*
>(
this)->
template get<first_type, 1>() * b.template get<first_type, 0>()
33#define LL_VEC_GEN_BASIC_MATH_FUNC_INT(NAME) \
35 [[nodiscard]] constexpr doubleN<T::size()> NAME(T const& x) noexcept \
36 requires(T::size() >= 2 && T::size() <= 4) \
38 doubleN<T::size()> tmp; \
39 T::forEachComponent([&]<typename axis_type, size_t iter> { \
40 tmp.template get<double, iter>() = static_cast<double>(std::NAME(x.template get<axis_type, iter>())); \
45LL_VEC_GEN_BASIC_MATH_FUNC_INT(acos)
46LL_VEC_GEN_BASIC_MATH_FUNC_INT(asin)
47LL_VEC_GEN_BASIC_MATH_FUNC_INT(atan)
48LL_VEC_GEN_BASIC_MATH_FUNC_INT(acosh)
49LL_VEC_GEN_BASIC_MATH_FUNC_INT(asinh)
50LL_VEC_GEN_BASIC_MATH_FUNC_INT(atanh)
51LL_VEC_GEN_BASIC_MATH_FUNC_INT(ceil)
52LL_VEC_GEN_BASIC_MATH_FUNC_INT(cos)
53LL_VEC_GEN_BASIC_MATH_FUNC_INT(cosh)
54LL_VEC_GEN_BASIC_MATH_FUNC_INT(exp)
55LL_VEC_GEN_BASIC_MATH_FUNC_INT(fabs)
56LL_VEC_GEN_BASIC_MATH_FUNC_INT(floor)
57LL_VEC_GEN_BASIC_MATH_FUNC_INT(log)
58LL_VEC_GEN_BASIC_MATH_FUNC_INT(log2)
59LL_VEC_GEN_BASIC_MATH_FUNC_INT(log10)
60LL_VEC_GEN_BASIC_MATH_FUNC_INT(round)
61LL_VEC_GEN_BASIC_MATH_FUNC_INT(sin)
62LL_VEC_GEN_BASIC_MATH_FUNC_INT(sinh)
63LL_VEC_GEN_BASIC_MATH_FUNC_INT(sqrt)
64LL_VEC_GEN_BASIC_MATH_FUNC_INT(tan)
65LL_VEC_GEN_BASIC_MATH_FUNC_INT(tanh)
Definition VectorBase.h:37