MCPcopy Create free account
hub / github.com/FreeFem/FreeFem-sources / invTransformCubicBzeirs

Function invTransformCubicBzeirs

plugin/seq/plotPDF.cpp:1981–2019  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1979 zx.push_back( x );
1980 zy.push_back( y );
1981 }
1982 }
1983 return;
1984}
1985
1986void invTransformCubicBzeirs( std::vector< std::vector<double> > &Cxs, std::vector< std::vector<double> > &Cys,
1987 const double *const PHI )
1988{
1989 const double EPS = 1e-10;
1990
1991 const double &lambda1 = PHI[0]; const double &lambda2 = PHI[1];
1992 const double &D = PHI[6]; const double &E = PHI[7];
1993
1994 const double &ev1x = PHI[2]; const double &ev1y = PHI[3];
1995 const double &ev2x = PHI[4]; const double &ev2y = PHI[5];
1996 const double P[2][2] = { { ev1x, ev2x }, { ev1y, ev2y } };
1997
1998 assert( Cxs.size() == Cys.size() );
1999
2000 if( Cxs.size() == 0 ) return; // nothing to transform
2001
2002 for(size_t k = 0; k < Cxs.size(); k++){
2003
2004 std::vector<double> &Cx = Cxs[k];
2005 std::vector<double> &Cy = Cys[k];
2006
2007 assert( Cx.size() == Cy.size() );
2008
2009 for(size_t j = 0; j < Cx.size(); j++){ // j=0 : starting point
2010
2011 double Px = Cx[j];
2012 double Py = Cy[j];
2013
2014 if( fabs(lambda1) > EPS )
2015 Px -= D/(2*lambda1);
2016 if( fabs(lambda2) > EPS )
2017 Py -= E/(2*lambda2);
2018
2019 Cx[j] = P[0][0] * Px + P[0][1] * Py;
2020 Cy[j] = P[1][0] * Px + P[1][1] * Py;
2021 }
2022 } // k

Callers 2

plot_P2_isoline_bodyFunction · 0.85
plot_P2_fillFunction · 0.85

Calls 2

fabsFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected