26 constexpr circle() noexcept : _v()
31 [[nodiscard]]
constexpr explicit circle(f32x4 v) noexcept : _v(v)
36 [[nodiscard]]
constexpr explicit operator f32x4()
const noexcept
41 [[nodiscard]]
constexpr circle(point3 point,
float radius) noexcept :
50 hilet square_ = f32x4{square};
53 _v = (addsub<0b0011>(square_.zwzw(), square_.xyxy()) * 0.5f).xy0w();
57 [[nodiscard]]
constexpr bool empty()
const noexcept
59 return _v.w() == 0.0f;
62 [[nodiscard]]
explicit operator bool ()
const noexcept
67 [[nodiscard]]
constexpr float radius()
const noexcept
72 [[nodiscard]]
constexpr point3 center()
const noexcept
74 return point3{_v.xyz1()};
77 [[nodiscard]]
constexpr friend circle operator+(
circle const &lhs,
float rhs)
noexcept
79 return circle{lhs._v + insert<3>(f32x4{}, rhs)};
82 [[nodiscard]]
constexpr friend circle operator-(
circle const &lhs,
float rhs)
noexcept
84 return circle{lhs._v - insert<3>(f32x4{}, rhs)};
87 [[nodiscard]]
constexpr friend circle operator*(
circle const &lhs,
float rhs)
noexcept
89 return circle{lhs._v * insert<3>(f32x4::broadcast(1.0f), rhs)};
92 [[nodiscard]]
constexpr friend point3 midpoint(
circle const &rhs)
noexcept
94 return point3{rhs.center()};
97 [[nodiscard]]
constexpr friend aarectangle bounding_rectangle(
circle const &rhs)
noexcept
99 hilet p = rhs._v.xyxy();
100 hilet r = neg<0b0011>(rhs._v.wwww());
108 [[nodiscard]]
constexpr bool holds_invariant()
const noexcept
110 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
@ other
The gui_event does not have associated data.
DOXYGEN BUG.
Definition algorithm.hpp:15
geometry/margins.hpp
Definition assert.hpp:18
Class which represents an axis-aligned rectangle.
Definition axis_aligned_rectangle.hpp:28
A type defining a 2D circle.
Definition circle.hpp:19