Add volume & normal of a simplex
This commit is contained in:
parent
007fd12240
commit
7697adcc68
1 changed files with 12 additions and 0 deletions
|
|
@ -160,6 +160,18 @@ namespace psemek::geom
|
||||||
return length(p2 - p1);
|
return length(p2 - p1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename P, typename ... Points>
|
||||||
|
auto volume(P const & p0, Points const & ... ps)
|
||||||
|
{
|
||||||
|
return det((ps - p0)...);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename P, typename ... Points>
|
||||||
|
auto normal(P const & p0, Points const & ... ps)
|
||||||
|
{
|
||||||
|
return normalized(ort((ps - p0)...));
|
||||||
|
}
|
||||||
|
|
||||||
template <typename Stream, typename T, std::size_t N>
|
template <typename Stream, typename T, std::size_t N>
|
||||||
Stream & operator << (Stream & os, point<T, N> const & p)
|
Stream & operator << (Stream & os, point<T, N> const & p)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue