33#include <NDEVR/BaseValues.h>
34#include <NDEVR/Vertex.h>
35#include <NDEVR/VectorFunctions.h>
55 template<u
int01 t_dims,
class t_type,
class t_vertex = Vertex<t_dims, t_type>>
84 static_assert(t_dims == 2,
"Radial Object given 3 points must be defined in 2 dimensions");
93 m_center = b + q * (e[
X] * (b[
Y] - a[
Y]) - e[
Y] * (b[
X] - a[
X])) / (e[
Y] * q[
X] - e[
X] * q[
Y]);
113 template<
bool t_allow_bounds = true>
114 constexpr bool contains(
const t_vertex& vector)
const
134 constexpr t_type
radius()
const {
return m_radius;}
149 template<u
int01 t_new_dims,
class t_new_type,
class t_new_vertex = Vertex<t_new_dims, t_new_type>>
167 [[nodiscard]]
constexpr const t_vertex&
center()
const {
return m_center;}
171 return m_radius == rad.m_radius && (m_center == rad.m_center);
175 return m_radius != rad.m_radius || m_center != rad.m_center;
184 template<u
int01 t_dims,
class t_type,
class t_vector>
201 template<u
int01 t_dims,
class t_type,
class t_vertex = Vertex<t_dims, t_type>>
206 : m_axis_major(
Vector<t_dims, t_type>(0.0))
210 : m_axis_major(p1, p2)
215 template<
class t_matrix_type = fltp08>
222 object.m_axis_major[
A] =
center + direction;
223 object.m_axis_major[
B] =
center - direction;
227 object.m_radius =
getMin(scale[
X], scale[
Y]);
246 constexpr bool contains(
const t_vertex& vector)
const
249 return m_radius > total_distance -
distance<fltp08>(m_axis_major[
A], m_axis_major[
B]);
264 constexpr t_type
radius()
const {
return m_radius; }
279 template<u
int01 t_new_dims,
class t_new_type>
300 return m_axis_major[vertex];
303 template<
class t_ratio_type = fltp08>
309 template<
class t_matrix_type = fltp08>
313 if (m_axis_major[
B] - m_axis_major[
A] == t_vertex(0))
317 mat = mat.
scale(axis, scale);
Definition RadialObject.hpp:203
t_ratio_type minorToMajorRatio() const
Definition RadialObject.hpp:304
constexpr t_type radius() const
Definition RadialObject.hpp:264
constexpr const t_vertex & axisPoint(uint01 vertex) const
Definition RadialObject.hpp:298
Matrix< t_matrix_type > fromCircleTransform() const
Definition RadialObject.hpp:310
constexpr BiRadialObject< t_new_dims, t_new_type > as() const
Definition RadialObject.hpp:280
static BiRadialObject< t_dims, t_type, t_vertex > fromCircleTransform(const Matrix< t_matrix_type > &mat)
Definition RadialObject.hpp:216
constexpr bool contains(const t_vertex &vector) const
Definition RadialObject.hpp:246
constexpr t_vertex center() const
Definition RadialObject.hpp:297
constexpr BiRadialObject(const t_vertex &p1, const t_vertex &p2, t_type radius)
Definition RadialObject.hpp:209
constexpr BiRadialObject(t_type r=0)
Definition RadialObject.hpp:205
Definition Matrix.hpp:173
constexpr Matrix scale(t_type scale) const
Definition Matrix.hpp:579
constexpr Vector< 3, t_type > decomposeOffset() const
Definition Matrix.hpp:440
static constexpr Matrix< t_type > ScalerMatrix(t_type scale)
Definition Matrix.hpp:304
constexpr Vector< 3, t_type > decomposeScale() const
Definition Matrix.hpp:421
A radial object.
Definition RadialObject.hpp:57
constexpr RadialObject< t_new_dims, t_new_type > as() const
Definition RadialObject.hpp:150
constexpr t_type radius() const
Definition RadialObject.hpp:134
constexpr RadialObject(const t_vertex ¢er, t_type radius)
Definition RadialObject.hpp:63
constexpr RadialObject(const t_vertex &vertex_a, const t_vertex &vertex_b, const t_vertex &vertex_c)
Definition RadialObject.hpp:80
constexpr RadialObject(t_type r=0)
Definition RadialObject.hpp:59
bool operator!=(const RadialObject &rad) const
Definition RadialObject.hpp:173
bool operator==(const RadialObject &rad) const
Definition RadialObject.hpp:169
constexpr const t_vertex & center() const
Definition RadialObject.hpp:167
constexpr bool contains(const t_vertex &vector) const
Definition RadialObject.hpp:114
Definition Vertex.hpp:341
An element of a vector space. An element of the real coordinate space Rn Basis vector,...
Definition Vector.hpp:62
A vertex.
Definition Vertex.hpp:54
@ vertex_a
Definition Triangle.hpp:57
@ vertex_b
Definition Triangle.hpp:58
@ vertex_c
Definition Triangle.hpp:59
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:98
t_type distanceSquared(const Bounds< t_dims, t_type, t_vertex > &bounds, const Vector< t_dims, t_type > &vertex)
Definition Distance.hpp:42
constexpr t_to cast(const Angle< t_from > &value)
Definition Angle.h:514
constexpr t_type distance(const t_vertex &vertex, const LineSegment< t_dims, t_type, t_vertex > &line)
Definition Distance.hpp:250
@ B
Definition BaseValues.hpp:203
@ A
Definition BaseValues.hpp:201
@ Y
Definition BaseValues.hpp:202
@ X
Definition BaseValues.hpp:200
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:181
constexpr t_type getMin(const t_type &left, const t_type &right)
Finds the minimum of the given arguments based on the < operator.
Definition BaseFunctions.hpp:67
Definition BaseValues.hpp:272
static const t_type Min
Definition BaseValues.hpp:276
static const t_type Max
Definition BaseValues.hpp:278
static const t_type NaN
Definition BaseValues.hpp:274