Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LeweC committed Feb 7, 2024
1 parent dd2be21 commit 459356b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions octree.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,28 @@ namespace OrthoTree
return sqrt(size2(pt));
}

static constexpr geometry_type pose_size(vector_type const& pt) noexcept
{
auto d2 = geometry_type{ 0 };
auto angle_dis = geometry_type{ 0 };
for (dim_type iDim = 0; iDim < nDimension; ++iDim)
{
if (iDim < 3)
{
autoc d = base::point_comp_c(pt, iDim);
d2 += d * d;
}
else
{
angle_dis += base::point_comp_c(pt, iDim);
}
}
autoc translation_part = sqrt(d2);
autoc orientation_part = angle_dis / 3;

return translation_part + orientation_part;
}

static constexpr vector_type add(vector_type const& ptL, vector_type const& ptR) noexcept
{
auto pt = vector_type{};
Expand Down

0 comments on commit 459356b

Please sign in to comment.