Change geom::length behavior: always (max-min), even if empty
This commit is contained in:
parent
10213bb3d9
commit
c1d9095327
2 changed files with 3 additions and 3 deletions
|
|
@ -91,7 +91,7 @@ namespace psemek::geom
|
|||
|
||||
T length() const
|
||||
{
|
||||
return empty() ? T{} : max - min;
|
||||
return max - min;
|
||||
}
|
||||
|
||||
T center() const
|
||||
|
|
|
|||
|
|
@ -79,10 +79,10 @@ namespace psemek::geom
|
|||
auto m = matrix<T, D + 1, D + 1>::zero();
|
||||
|
||||
for (std::size_t d = 0; d < D; ++d)
|
||||
m[d][d] = T(2) / (r_[d].max - r_[d].min);
|
||||
m[d][d] = T(2) / r_[d].length();
|
||||
|
||||
for (std::size_t d = 0; d < D; ++d)
|
||||
m[d][D] = - (r_[d].max + r_[d].min) / (r_[d].max - r_[d].min);
|
||||
m[d][D] = - (r_[d].max + r_[d].min) / r_[d].length();
|
||||
|
||||
m[D][D] = T(1);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue