preCICE v3.1.2
Loading...
Searching...
No Matches
Classes | Namespaces | Enumerations | Functions
geometry.hpp File Reference
#include <Eigen/Core>
#include <array>
#include "math/differences.hpp"
#include "utils/assertion.hpp"
Include dependency graph for geometry.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  precice::math::geometry::ConvexityResult
 

Namespaces

namespace  precice
 Main namespace of the precice library.
 
namespace  precice::math
 provides general mathematical constants and functions.
 
namespace  precice::math::geometry
 Provides computational geometry operations.
 

Enumerations

enum  precice::math::geometry::ResultConstants {
  precice::math::geometry::NO_INTERSECTION , precice::math::geometry::INTERSECTION , precice::math::geometry::TOUCHING , precice::math::geometry::NOT_CONTAINED ,
  precice::math::geometry::CONTAINED
}
 

Functions

bool precice::math::geometry::lineIntersection (const Eigen::Ref< const Eigen::Vector2d > &a, const Eigen::Ref< const Eigen::Vector2d > &b, const Eigen::Ref< const Eigen::Vector2d > &c, const Eigen::Ref< const Eigen::Vector2d > &d, Eigen::Ref< Eigen::Vector2d > &intersectionPoint)
 Determines the intersection point of two lines, if one exists.
 
ResultConstants precice::math::geometry::segmentPlaneIntersection (const Eigen::Vector3d &pointOnPlane, const Eigen::Vector3d &planeNormal, const Eigen::Vector3d &firstPointSegment, const Eigen::Vector3d &secondPointSegment, Eigen::Vector3d &intersectionPoint)
 Determines the intersection point of a segment with a plane in 3D.
 
template<typename VECTORA_T , typename VECTORB_T , typename VECTORC_T >
bool precice::math::geometry::between (const VECTORA_T &a, const VECTORB_T &b, const VECTORC_T &toCheck)
 Determines, if a point lies on the line segment defined by a, b.
 
template<typename Derived >
bool precice::math::geometry::collinear (const Eigen::MatrixBase< Derived > &a, const Eigen::MatrixBase< Derived > &b, const Eigen::MatrixBase< Derived > &c)
 Determines, if three points are collinear (on one line)
 
template<typename Derived >
static bool precice::math::geometry::parallel (const Eigen::MatrixBase< Derived > &a, const Eigen::MatrixBase< Derived > &b, const Eigen::MatrixBase< Derived > &c, const Eigen::MatrixBase< Derived > &d)
 Determines, if two lines are parallel to each other.
 
double precice::math::geometry::triangleArea (const Eigen::VectorXd &a, const Eigen::VectorXd &b, const Eigen::VectorXd &c)
 Computes the signed area of a triangle in 2D.
 
double precice::math::geometry::tetraVolume (const Eigen::Vector3d &a, const Eigen::Vector3d &b, const Eigen::Vector3d &c, const Eigen::Vector3d &d)
 Computes the (unsigned) area of a triangle in 3D.
 
Eigen::Vector2d precice::math::geometry::projectVector (const Eigen::Vector3d &vector, const int indexDimensionToRemove)
 Projects a 3D vector to a 2D one by removing one dimension.
 
template<class Derived >
int precice::math::geometry::containedInHyperrectangle (const Eigen::MatrixBase< Derived > &sidelengths, const Eigen::MatrixBase< Derived > &center, const Eigen::MatrixBase< Derived > &testPoint)
 Tests, if a vertex is contained in a hyperrectangle.
 
template<class Derived >
bool precice::math::geometry::parallel (const Eigen::MatrixBase< Derived > &a, const Eigen::MatrixBase< Derived > &b, const Eigen::MatrixBase< Derived > &c, const Eigen::MatrixBase< Derived > &d)
 Determines, if two lines are parallel to each other.
 
ConvexityResult precice::math::geometry::isConvexQuad (std::array< Eigen::VectorXd, 4 > coords)