mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
added midpoint for triangle class
This commit is contained in:
@@ -29,5 +29,8 @@ namespace omath
|
|||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
Vector3 SideBVector() const;
|
Vector3 SideBVector() const;
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
|
Vector3 MidPoint() const;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,4 +33,8 @@ namespace omath
|
|||||||
{
|
{
|
||||||
return m_vertex3 - m_vertex2;
|
return m_vertex3 - m_vertex2;
|
||||||
}
|
}
|
||||||
}
|
Vector3 Triangle3d::MidPoint() const
|
||||||
|
{
|
||||||
|
return (m_vertex1 + m_vertex2 + m_vertex3) / 3;
|
||||||
|
}
|
||||||
|
} // namespace omath
|
||||||
|
|||||||
Reference in New Issue
Block a user