#include <stdio.h>
#include <math.h>
#include "geo.h"
Go to the source code of this file.
#define dcos | ( | x | ) | cos(RAD(x)) |
Definition at line 17 of file geo.c.
Referenced by PFSGeoRotateAxis(), PFSGeoRotateX(), PFSGeoRotateY(), and PFSGeoRotateZ().
#define dsin | ( | x | ) | sin(RAD(x)) |
Definition at line 16 of file geo.c.
Referenced by PFSGeoRotateAxis(), PFSGeoRotateX(), PFSGeoRotateY(), and PFSGeoRotateZ().
#define real double |
Definition at line 9 of file geo.c.
Referenced by PFSGeoAngPtAboutPt(), PFSGeoAngVecAboutLine(), PFSGeoGenPlanEqn(), PFSGeoGenPoly(), PFSGeoIntscLinePlane(), PFSGeoIntscPolyLine(), PFSGeoInvert2x2(), PFSGeoInvert3x3(), PFSGeoIsOnPlane(), PFSGeoIsOnPolyBdry(), PFSGeoLstSqrPlanEqn(), PFSGeoPerpLine(), PFSGeoPlanEqnToParPlan(), PFSGeoPolyNormal(), PFSGeoProjVecPlane(), PFSGeoPtNormToParPlan(), PFSGeoRotateAxis(), PFSGeoRotateX(), PFSGeoRotateY(), PFSGeoRotateZ(), PFSGeoSideofPlan(), and PFSGeoVecNormalize().
PFSGeoStatus PFSGeo3PointsToNormPlane | ( | in0 | , | |
in1 | , | |||
in2 | , | |||
plane | ||||
) |
Definition at line 1773 of file geo.c.
References PFSGeoNormPlane::a, PFSGeoNormPlane::n, PFSGeoCrossProd(), PFSGeoDiffVec(), PFSGeoInvalid, PFSGeoNullVec(), PFSGeoPlanToNormPlan(), PFSGeoTolerance, PFSGeoValid, PFSGeoNormPlane::u, and PFSGeoNormPlane::v.
real PFSGeoAngPtAboutLine | ( | l | , | |
PFSGeoPoint * | p0, | |||
PFSGeoPoint * | p1 | |||
) |
Definition at line 1970 of file geo.c.
References PFSGeoAngVecAboutLine(), PFSGeoClstPtLine(), PFSGeoPoint::x, PFSGeoPoint::y, and PFSGeoPoint::z.
Referenced by pfsAddAdjNode().
real PFSGeoAngPtAboutPt | ( | pivot | , | |
PFSGeoPoint * | p0, | |||
PFSGeoPoint * | p1 | |||
) |
Definition at line 1998 of file geo.c.
References PFSGeoLine::d, PFSGeoLine::e, PFSGeoAngVecAboutLine(), PFSGeoCrossProd(), PFSGeoDotProd(), PFSGeoNullVec(), PFSGeoTolerance, PFSGeoTrue, real, PFSGeoPoint::x, PFSGeoPoint::y, and PFSGeoPoint::z.
real PFSGeoAngVecAboutLine | ( | l | , | |
PFSGeoPoint * | v0, | |||
PFSGeoPoint * | v1 | |||
) |
Definition at line 1922 of file geo.c.
References PFSGeoCrossProd(), PFSGeoDotProd(), PFSGeoFalse, PFSGeoNullVec(), PFSGeoTolerance, PFSGeoVecLen(), real, PFSGeoPoint::x, PFSGeoPoint::y, and PFSGeoPoint::z.
Referenced by PFSGeoAngPtAboutLine(), and PFSGeoAngPtAboutPt().
void PFSGeoCentroid | ( | num_pts | , | |
pts | , | |||
cntrd | ||||
) |
Definition at line 1654 of file geo.c.
References PFSGeoPoint::x, PFSGeoPoint::y, and PFSGeoPoint::z.
void PFSGeoClstPtLine | ( | line | , | |
PFSGeoPoint * | pt, | |||
PFSGeoPoint * | clst, | |||
par | ||||
) |
Definition at line 1167 of file geo.c.
References PFSGeoDotProd(), PFSGeoEvalLine(), PFSGeoPoint::x, PFSGeoPoint::y, and PFSGeoPoint::z.
Referenced by PFSGeoAngPtAboutLine(), and PFSGeoIsOnPolyBdry().
void PFSGeoClstPtNormPlane | ( | plane | , | |
PFSGeoPoint * | pt, | |||
PFSGeoPoint * | clst, | |||
spar | ||||
) |
Definition at line 1185 of file geo.c.
References PFSGeoEvalPlane(), PFSGeoTripleProd(), PFSGeoSurfPar::u, PFSGeoSurfPar::v, PFSGeoPoint::x, PFSGeoPoint::y, and PFSGeoPoint::z.
Referenced by pfsDistPntCurElem(), PFSGeoClstPtPoly(), PFSGeoDistPtNormPlane(), and pfsInitParams().
PFSGeoStatus PFSGeoClstPtPoly | ( | poly | , | |
PFSGeoPoint * | pt, | |||
PFSGeoPoint * | clst, | |||
spar | ||||
) |
Definition at line 1204 of file geo.c.
References PFSGeoClstPtNormPlane(), PFSGeoInvalid, PFSGeoIsInsidePoly(), PFSGeoIsOnPolyBdry(), PFSGeoTrue, and PFSGeoValid.
void PFSGeoCrossProd | ( | PFSGeoPoint * | in0, | |
PFSGeoPoint * | in1, | |||
PFSGeoPoint * | out | |||
) |
Definition at line 539 of file geo.c.
Referenced by _surfaceCurrElemTransfMtx(), _surfaceLocalT3Coord(), pfsArea3d(), pfsDistPntCurElem(), PFSGeo3PointsToNormPlane(), PFSGeoAngPtAboutPt(), PFSGeoAngVecAboutLine(), PFSGeoGenPoly(), PFSGeoIntscLinePlane(), PFSGeoLstSqrPlanEqn(), PFSGeoPerpLine(), PFSGeoPlanEqnToParPlan(), PFSGeoPlanToNormPlan(), PFSGeoPtNormToParPlan(), PFSGeoTripleProd(), and pfsInitParams().
void PFSGeoDiffVec | ( | PFSGeoPoint * | in0, | |
PFSGeoPoint * | in1, | |||
PFSGeoPoint * | out | |||
) |
Definition at line 604 of file geo.c.
Referenced by _surfaceCurrElemTransfMtx(), _surfaceLocalT3Coord(), pfsDistPntCurElem(), pfsFinishFreeFaceShotLen(), PFSGeo3PointsToNormPlane(), PFSGeoLstSqrPlanEqn(), and pfsUpdateShotLen().
PFSGeoStatus PFSGeodInvert3x3 | ( | a | , | |
b | ||||
) |
real PFSGeoDist | ( | in0 | , | |
in1 | ||||
) |
Definition at line 591 of file geo.c.
References PFSGeoVecLen(), PFSGeoPoint::x, PFSGeoPoint::y, and PFSGeoPoint::z.
Referenced by pfsDistPntCurElem(), PFSGeoDistPtNormPlane(), PFSGeoGenPoly(), PFSGeoIsOnPolyBdry(), PFSGeoPolyNormal(), and pfsLoopShot().
real PFSGeoDistPtNormPlane | ( | plane | , | |
pt | ||||
) |
Definition at line 2059 of file geo.c.
References PFSGeoClstPtNormPlane(), and PFSGeoDist().
real PFSGeoDotProd | ( | PFSGeoPoint * | vec0, | |
PFSGeoPoint * | vec1 | |||
) |
Definition at line 531 of file geo.c.
Referenced by _surfaceLocalT3Coord(), pfsArea3d(), pfsFindRefElem(), PFSGeoAngPtAboutPt(), PFSGeoAngVecAboutLine(), PFSGeoClstPtLine(), PFSGeoIntscLinePlane(), PFSGeoIsInsidePoly(), PFSGeoIsOnPlane(), PFSGeoProjVecPlane(), and PFSGeoTripleProd().
void PFSGeoDyadProd | ( | PFSGeoPoint * | vec0, | |
PFSGeoPoint * | vec1, | |||
matr | ||||
) |
void PFSGeoEvalLine | ( | par | , | |
line | , | |||
pt | ||||
) |
Definition at line 390 of file geo.c.
References PFSGeoLine::d, PFSGeoLine::e, PFSGeoPoint::x, PFSGeoPoint::y, and PFSGeoPoint::z.
Referenced by PFSGeoClstPtLine(), PFSGeoIntscLinePlane(), and PFSGeoPerpLine().
void PFSGeoEvalPlane | ( | par | , | |
plane | , | |||
pt | ||||
) |
Definition at line 402 of file geo.c.
References PFSGeoPlane::a, PFSGeoPlane::b, PFSGeoPlane::c, PFSGeoPoint::x, PFSGeoPoint::y, and PFSGeoPoint::z.
Referenced by PFSGeoClstPtNormPlane().
void PFSGeoGenLine | ( | PFSGeoPoint * | pt0, | |
PFSGeoPoint * | pt1, | |||
line | ||||
) |
Definition at line 277 of file geo.c.
References PFSGeoLine::d, PFSGeoLine::e, PFSGeoPoint::x, PFSGeoPoint::y, and PFSGeoPoint::z.
Referenced by PFSGeoIsOnPlane(), and PFSGeoIsOnPolyBdry().
void PFSGeoGenPlane | ( | PFSGeoPoint * | pt0, | |
PFSGeoPoint * | pt1, | |||
PFSGeoPoint * | pt2, | |||
plane | ||||
) |
Definition at line 288 of file geo.c.
References PFSGeoPlane::a, PFSGeoPlane::b, PFSGeoPlane::c, PFSGeoPoint::x, PFSGeoPoint::y, and PFSGeoPoint::z.
void PFSGeoGenPlanEqn | ( | PFSGeoPoint * | pt0, | |
PFSGeoPoint * | pt1, | |||
PFSGeoPoint * | pt2, | |||
plan_eqn | ||||
) |
Definition at line 302 of file geo.c.
References PFSGeoPlanEqn::a, PFSGeoPlanEqn::b, PFSGeoPlanEqn::c, PFSGeoPlanEqn::d, real, PFSGeoPoint::x, PFSGeoPoint::y, and PFSGeoPoint::z.
Referenced by PFSGeoLstSqrPlanEqn().
PFSGeoStatus PFSGeoGenPoly | ( | n_verts | , | |
verts | , | |||
plane | ||||
) |
Definition at line 335 of file geo.c.
References PFSGeoNormPlane::a, PFSGeoNormPlane::n, PFSGeoCrossProd(), PFSGeoDist(), PFSGeoInvalid, PFSGeoPolyNormal(), PFSGeoValid, real, PFSGeoNormPlane::u, PFSGeoNormPlane::v, PFSGeoPoint::x, PFSGeoPoint::y, and PFSGeoPoint::z.
PFSGeoStatus PFSGeoIntscLinePlane | ( | line | , | |
plane | , | |||
pt | , | |||
ptpar | , | |||
spar | ||||
) |
Definition at line 826 of file geo.c.
References PFSGeoPlane::a, PFSGeoPlane::b, PFSGeoPlane::c, PFSGeoCrossProd(), PFSGeoDotProd(), PFSGeoEvalLine(), PFSGeoInvalid, PFSGeoTolerance, PFSGeoValid, PFSGeoVecLen(), real, size, PFSGeoSurfPar::u, and PFSGeoSurfPar::v.
Referenced by PFSGeoIntscLinePoly().
PFSGeoStatus PFSGeoIntscLinePoly | ( | line | , | |
poly | , | |||
pt | , | |||
ptpar | , | |||
spar | ||||
) |
Definition at line 868 of file geo.c.
References PFSGeoNormPlane::a, PFSGeoPlane::a, PFSGeoPlane::b, PFSGeoPlane::c, PFSGeoPoly::nplane, PFSGeoIntscLinePlane(), PFSGeoInvalid, PFSGeoIsInsidePoly(), PFSGeoIsOnPolyBdry(), PFSGeoTrue, PFSGeoValid, PFSGeoNormPlane::u, and PFSGeoNormPlane::v.
PFSGeoPredicate PFSGeoIntscPolyLine | ( | line | , | |
spar | ||||
) |
Definition at line 32 of file geo.c.
References PFSGeoFalse, PFSGeoTrue, real, PFSGeoSurfPar::u, and PFSGeoSurfPar::v.
Referenced by PFSGeoIsInsidePoly().
PFSGeoStatus PFSGeoInvert2x2 | ( | a | , | |
b | ||||
) |
PFSGeoStatus PFSGeoInvert3x3 | ( | a | , | |
b | ||||
) |
Definition at line 1584 of file geo.c.
References PFSGeoInvalid, PFSGeoValid, and real.
Referenced by PFSGeoPerpLine().
PFSGeoPredicate PFSGeoIsInsidePoly | ( | poly | , | |
spar | ||||
) |
Definition at line 131 of file geo.c.
References PFSGeoDotProd(), PFSGeoFalse, PFSGeoIntscPolyLine(), PFSGeoTrue, PFSGeoSurfPar::u, PFSGeoSurfPar::v, PFSGeoPoint::x, PFSGeoPoint::y, and PFSGeoPoint::z.
Referenced by PFSGeoClstPtPoly(), and PFSGeoIntscLinePoly().
PFSGeoPredicate PFSGeoIsOnPlane | ( | pt | , | |
pla | ||||
) |
Definition at line 1232 of file geo.c.
References PFSGeoNormPlane::a, PFSGeoLine::e, PFSGeoNormPlane::n, PFSGeoDotProd(), PFSGeoFalse, PFSGeoGenLine(), PFSGeoTolerance, PFSGeoTrue, PFSGeoVecLen(), and real.
PFSGeoPredicate PFSGeoIsOnPolyBdry | ( | poly | , | |
pt | ||||
) |
Definition at line 170 of file geo.c.
References PFSGeoClstPtLine(), PFSGeoDist(), PFSGeoFalse, PFSGeoGenLine(), PFSGeoTolerance, PFSGeoTrue, and real.
Referenced by PFSGeoClstPtPoly(), and PFSGeoIntscLinePoly().
void PFSGeoLinCombVec | ( | PFSGeoPoint * | in0, | |
real * | csi0, | |||
PFSGeoPoint * | in1, | |||
real * | csi1, | |||
PFSGeoPoint * | out | |||
) |
PFSGeoStatus PFSGeoLstSqrPlanEqn | ( | num_pts | , | |
pts | , | |||
plan_eqn | ||||
) |
Definition at line 999 of file geo.c.
References PFSGeoPlanEqn::a, PFSGeoPlanEqn::b, PFSGeoPlanEqn::c, PFSGeoPlanEqn::d, PFSGeoCrossProd(), PFSGeoDiffVec(), PFSGeoFalse, PFSGeoGenPlanEqn(), PFSGeoInvalid, PFSGeoNullVec(), PFSGeoTolerance, PFSGeoValid, real, PFSGeoPoint::x, PFSGeoPoint::y, and PFSGeoPoint::z.
PFSGeoPredicate PFSGeoNullVec | ( | vec | , | |
tolerance | ||||
) |
Definition at line 556 of file geo.c.
References PFSGeoFalse, and PFSGeoTrue.
Referenced by PFSGeo3PointsToNormPlane(), PFSGeoAngPtAboutPt(), PFSGeoAngVecAboutLine(), PFSGeoLstSqrPlanEqn(), PFSGeoPlanEqnToParPlan(), and PFSGeoPtNormToParPlan().
PFSGeoStatus PFSGeoPerpLine | ( | PFSGeoLine * | pl1, | |
PFSGeoLine * | pl2, | |||
PFSGeoLine * | pl3, | |||
PFSGeoPointPar * | u, | |||
PFSGeoPointPar * | v, | |||
PFSGeoPointPar * | w | |||
) |
void PFSGeoPlanEqnToParPlan | ( | plan_eqn | , | |
plane | ||||
) |
Definition at line 1795 of file geo.c.
References PFSGeoNormPlane::a, PFSGeoNormPlane::n, PFSGeoCrossProd(), PFSGeoNullVec(), PFSGeoTolerance, PFSGeoTrue, PFSGeoVecLen(), real, size, PFSGeoNormPlane::u, PFSGeoNormPlane::v, PFSGeoPoint::x, PFSGeoPoint::y, and PFSGeoPoint::z.
void PFSGeoPlanToNormPlan | ( | plane | , | |
normplane | ||||
) |
Definition at line 1760 of file geo.c.
References PFSGeoNormPlane::a, PFSGeoNormPlane::n, PFSGeoCrossProd(), PFSGeoVecNormalize(), PFSGeoNormPlane::u, and PFSGeoNormPlane::v.
Referenced by PFSGeo3PointsToNormPlane().
PFSGeoStatus PFSGeoPolyNormal | ( | n_verts | , | |
verts | , | |||
n | ||||
) |
Definition at line 954 of file geo.c.
References PFSGeoDist(), PFSGeoInvalid, PFSGeoTolerance, PFSGeoValid, PFSGeoVecLen(), real, PFSGeoPoint::x, PFSGeoPoint::y, and PFSGeoPoint::z.
Referenced by PFSGeoGenPoly().
void PFSGeoProdMatrVec | ( | matr | , | |
vec0 | , | |||
vec1 | ||||
) |
Definition at line 2091 of file geo.c.
References PFSGeoPoint::x, PFSGeoPoint::y, and PFSGeoPoint::z.
void PFSGeoProdScalVec | ( | PFSGeoPoint * | in, | |
csi | , | |||
PFSGeoPoint * | out | |||
) |
Definition at line 625 of file geo.c.
Referenced by pfsFinishFreeFaceShotLen(), and pfsUpdateShotLen().
PFSGeoStatus PFSGeoProjVecPlane | ( | vec | , | |
plane | , | |||
proj | ||||
) |
Definition at line 2037 of file geo.c.
References PFSGeoPlane::b, PFSGeoPlane::c, PFSGeoDotProd(), PFSGeoInvalid, PFSGeoTolerance, PFSGeoValid, real, PFSGeoPoint::x, PFSGeoPoint::y, and PFSGeoPoint::z.
void PFSGeoPtNormToParPlan | ( | PFSGeoPoint * | pt, | |
PFSGeoPoint * | normal, | |||
plane | ||||
) |
Definition at line 1716 of file geo.c.
References PFSGeoNormPlane::a, PFSGeoNormPlane::n, PFSGeoCrossProd(), PFSGeoNullVec(), PFSGeoTolerance, PFSGeoTrue, PFSGeoVecLen(), real, size, PFSGeoNormPlane::u, PFSGeoNormPlane::v, PFSGeoPoint::x, PFSGeoPoint::y, and PFSGeoPoint::z.
void PFSGeoRotateAxis | ( | axis | , | |
angle | , | |||
PFSGeoPoint * | in, | |||
PFSGeoPoint * | out | |||
) |
Definition at line 747 of file geo.c.
References dcos, dsin, PFSGeoVecNormalize(), real, PFSGeoPoint::x, PFSGeoPoint::y, and PFSGeoPoint::z.
void PFSGeoRotateX | ( | angle | , | |
PFSGeoPoint * | in, | |||
PFSGeoPoint * | out | |||
) |
Definition at line 708 of file geo.c.
References dcos, dsin, real, PFSGeoPoint::x, PFSGeoPoint::y, and PFSGeoPoint::z.
void PFSGeoRotateY | ( | angle | , | |
PFSGeoPoint * | in, | |||
PFSGeoPoint * | out | |||
) |
Definition at line 721 of file geo.c.
References dcos, dsin, real, PFSGeoPoint::x, PFSGeoPoint::y, and PFSGeoPoint::z.
void PFSGeoRotateZ | ( | angle | , | |
PFSGeoPoint * | in, | |||
PFSGeoPoint * | out | |||
) |
Definition at line 734 of file geo.c.
References dcos, dsin, real, PFSGeoPoint::x, PFSGeoPoint::y, and PFSGeoPoint::z.
void PFSGeoSetTolerance | ( | real | tol | ) |
PFSGeoPtTest PFSGeoSideofPlan | ( | plan_eqn | , | |
pt | ||||
) |
Definition at line 1856 of file geo.c.
References PFSGeoAbove, PFSGeoBelow, PFSGeoOn, PFSGeoTolerance, real, PFSGeoPoint::x, PFSGeoPoint::y, and PFSGeoPoint::z.
void PFSGeoSumVec | ( | PFSGeoPoint * | in0, | |
PFSGeoPoint * | in1, | |||
PFSGeoPoint * | out | |||
) |
Definition at line 614 of file geo.c.
Referenced by pfsFinishFreeFaceShotLen(), and pfsUpdateShotLen().
void PFSGeoSurfInterp | ( | num_pts | , | |
map_func | , | |||
pts_val | , | |||
interp_val | ||||
) |
void PFSGeoSurfJacob | ( | num_pts | , | |
map_deriv_s | , | |||
map_deriv_t | , | |||
pts_val | , | |||
jac | ||||
) |
real PFSGeoTripleProd | ( | PFSGeoPoint * | vec0, | |
PFSGeoPoint * | vec1, | |||
PFSGeoPoint * | vec2 | |||
) |
Definition at line 547 of file geo.c.
Referenced by PFSGeoClstPtNormPlane().
real PFSGeoVecLen | ( | vec | ) |
Definition at line 568 of file geo.c.
Referenced by _surfaceLocalT3Coord(), pfsArea3d(), pfsElemNormal(), pfsFindRefElem(), PFSGeoAngVecAboutLine(), PFSGeoDist(), PFSGeoIntscLinePlane(), PFSGeoIsOnPlane(), PFSGeoPlanEqnToParPlan(), PFSGeoPolyNormal(), PFSGeoPtNormToParPlan(), PFSGeoVecNormalize(), pfsInitParams(), pfsNodeConstrNormal(), pfsNodeNormal(), and pfsUpdateShotLen().
void PFSGeoVecNormalize | ( | vec | , | |
n | ||||
) |
Definition at line 577 of file geo.c.
References PFSGeoVecLen(), real, PFSGeoPoint::x, PFSGeoPoint::y, and PFSGeoPoint::z.
Referenced by _surfaceCurrElemTransfMtx(), _surfaceLocalT3Coord(), pfsDistPntCurElem(), pfsFinishFreeFaceShotLen(), PFSGeoPlanToNormPlan(), PFSGeoRotateAxis(), pfsInitParams(), and pfsUpdateShotLen().
real PFSGeoTolerance = 0.0001 [static] |
Definition at line 12 of file geo.c.
Referenced by PFSGeo3PointsToNormPlane(), PFSGeoAngPtAboutPt(), PFSGeoAngVecAboutLine(), PFSGeoGetTolerance(), PFSGeoIntscLinePlane(), PFSGeoIsOnPlane(), PFSGeoIsOnPolyBdry(), PFSGeoLstSqrPlanEqn(), PFSGeoPlanEqnToParPlan(), PFSGeoPolyNormal(), PFSGeoProjVecPlane(), PFSGeoPtNormToParPlan(), PFSGeoSetTolerance(), and PFSGeoSideofPlan().