2025-05-07 19:18:58 +02:00
|
|
|
/*
|
2026-02-05 01:18:05 +01:00
|
|
|
Crafter®.Math
|
|
|
|
|
Copyright (C) 2026 Catcrafts®
|
|
|
|
|
catcrafts.net
|
2025-05-07 19:18:58 +02:00
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
2026-02-05 01:18:05 +01:00
|
|
|
License version 3.0 as published by the Free Software Foundation;
|
2025-05-07 19:18:58 +02:00
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
License along with this library; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
|
*/
|
|
|
|
|
|
2025-05-05 02:01:44 +02:00
|
|
|
|
2026-02-11 02:52:03 +01:00
|
|
|
export module Crafter.Math:Basic;
|
2026-01-29 20:19:20 +01:00
|
|
|
import std;
|
2026-03-31 14:22:18 +02:00
|
|
|
import :VectorF32;
|
2025-05-05 02:01:44 +02:00
|
|
|
|
|
|
|
|
namespace Crafter {
|
2026-02-11 02:52:03 +01:00
|
|
|
template<typename T>
|
|
|
|
|
constexpr T ToRadian(T degrees) {
|
|
|
|
|
return degrees * (std::numbers::pi / 180);
|
|
|
|
|
}
|
2026-03-22 20:53:17 +01:00
|
|
|
|
2026-03-25 00:42:04 +01:00
|
|
|
#ifdef __x86_64
|
|
|
|
|
#ifndef __AVX512FP16__
|
2026-03-23 21:42:40 +01:00
|
|
|
export template <std::uint32_t Len, std::uint32_t Packing>
|
2026-03-25 00:42:04 +01:00
|
|
|
using VectorF16 = VectorF32<Len, Packing>;
|
|
|
|
|
#endif
|
2026-03-22 20:53:17 +01:00
|
|
|
#endif
|
2025-05-05 05:14:39 +02:00
|
|
|
}
|