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()
22 hi_axiom(holds_invariant());
25 [[nodiscard]]
constexpr explicit circle(
f32x4 v) noexcept : _v(v)
27 hi_axiom(holds_invariant());
30 [[nodiscard]]
constexpr explicit operator f32x4()
const noexcept
35 [[nodiscard]]
constexpr circle(
point3 point,
float radius) noexcept :
39 hi_axiom(holds_invariant());
47 _v = (addsub<0b0011>(square_.zwzw(), square_.xyxy()) * 0.5f).xy0w();
48 hi_axiom(holds_invariant());
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;