8#include "axis_aligned_rectangle.hpp"
11namespace hi::inline
v1 {
15 constexpr circle(
circle const &other)
noexcept =
default;
17 constexpr circle &operator=(
circle const &other)
noexcept =
default;
18 constexpr circle &operator=(
circle &&other)
noexcept =
default;
20 constexpr circle() noexcept : _v()
25 [[nodiscard]]
constexpr explicit circle(
f32x4 v) noexcept : _v(v)
30 [[nodiscard]]
constexpr explicit operator f32x4()
const noexcept
35 [[nodiscard]]
constexpr circle(
point3 point,
float radius) noexcept :
47 _v = (addsub<0b0011>(square_.zwzw(), square_.xyxy()) * 0.5f).xy0w();
51 [[nodiscard]]
constexpr bool empty()
const noexcept
53 return _v.w() == 0.0f;
56 [[nodiscard]]
explicit operator bool ()
const noexcept
61 [[nodiscard]]
constexpr float radius()
const noexcept
71 [[nodiscard]]
constexpr friend circle operator+(
circle const &lhs,
float rhs)
noexcept
76 [[nodiscard]]
constexpr friend circle operator-(
circle const &lhs,
float rhs)
noexcept
81 [[nodiscard]]
constexpr friend circle operator*(
circle const &lhs,
float rhs)
noexcept
83 return circle{lhs._v * insert<3>(f32x4::broadcast(1.0f), rhs)};
86 [[nodiscard]]
constexpr friend point3 midpoint(
circle const &rhs)
noexcept
88 return point3{rhs.center()};
91 [[nodiscard]]
constexpr friend aarectangle bounding_rectangle(
circle const &rhs)
noexcept
93 hilet p = rhs._v.xyxy();
94 hilet r = neg<0b0011>(rhs._v.wwww());
102 [[nodiscard]]
constexpr bool holds_invariant()
const noexcept
104 return _v.w() >= 0.0f;
#define hi_axiom(expression)
Specify an axiom; an expression that is true.
Definition assert.hpp:133
#define hilet
Invariant should be the default for variables.
Definition utility.hpp:23
DOXYGEN BUG.
Definition algorithm.hpp:15
@ square
<square> asian compatibility forms.
@ center
Align the text in the center.
Class which represents an axis-aligned rectangle.
Definition axis_aligned_rectangle.hpp:20