Skip to content

Commit

Permalink
feat: gets normal of a 2d element given the axes
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanshauer committed Aug 20, 2024
1 parent 3f3114c commit 4abd50b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Util/pzaxestools.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include "pzfmatrix.h"
#include "pzerror.h"
#include "pzvec_extras.h"

/**
* @ingroup util
Expand Down Expand Up @@ -144,6 +145,15 @@ class TPZAxesTools {
}
}

static void GetNormal(TPZFMatrix<TVar> &axes, TPZVec<REAL>& normal){
if (axes.Rows() != 2) {
DebugStop();
}
TPZManVector<REAL,3> ax1 = {axes(0,0),axes(0,1),axes(0,2)};
TPZManVector<REAL,3> ax2 = {axes(1,0),axes(1,1),axes(1,2)};
Cross(ax1,ax2,normal);
}

/** Test code */
static int main(){
TPZFMatrix<> axes(2,3,0.);
Expand Down

0 comments on commit 4abd50b

Please sign in to comment.