mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#9470 User defined perf length for azimuth fractures
Fractures: Add UI for user-defined perforation length for az fractures Add user defined perforation length for azimuth fractures. Janitor: remove duplication
This commit is contained in:
committed by
GitHub
parent
4345cb3a70
commit
e8789f3d4b
@@ -165,6 +165,21 @@ double GeometryTools::getAngle( const cvf::Vec3d& v1, const cvf::Vec3d& v2 )
|
||||
return angle;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Mat4d GeometryTools::rotationMatrixBetweenVectors( const cvf::Vec3d& v1, const cvf::Vec3d& v2 )
|
||||
{
|
||||
cvf::Vec3d rotAxis = v1 ^ v2;
|
||||
rotAxis.normalize();
|
||||
|
||||
// Guard acos against out-of-domain input
|
||||
const double dotProduct = cvf::Math::clamp( v1 * v2, -1.0, 1.0 );
|
||||
const double angle = cvf::Math::acos( dotProduct );
|
||||
cvf::Mat4d rotMat = cvf::Mat4d::fromRotation( rotAxis, angle );
|
||||
return rotMat;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user