[Plib-cvs] plib/src/sg sg.cxx,1.30,1.31 sg.h,1.32,1.33
Brought to you by:
sjbaker
From: Steve B. <sj...@us...> - 2002-06-10 05:42:37
|
Update of /cvsroot/plib/plib/src/sg In directory usw-pr-cvs1:/tmp/cvs-serv19464/plib/src/sg Modified Files: sg.cxx sg.h Log Message: Added a diagram to the documentation and new functions for Angle/Side/Side and Side/Side/Angle. Index: sg.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/sg/sg.cxx,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- sg.cxx 10 Jun 2002 03:46:52 -0000 1.30 +++ sg.cxx 10 Jun 2002 05:42:33 -0000 1.31 @@ -1735,6 +1735,24 @@ } +SGfloat sgTriangleSolver_ASStoArea ( SGfloat angB, SGfloat lenA, SGfloat lenB ) +{ + SGfloat lenC ; + + sgTriangleSolver_ASStoSAA ( angB, lenA, lenB, &lenC, NULL, NULL ) ; + + return sgTriangleSolver_SAStoArea ( lenA, angB, lenC ) ; +} + +SGfloat sgTriangleSolver_SAAtoArea ( SGfloat lenA, SGfloat angB, SGfloat angA ) +{ + SGfloat lenC ; + + sgTriangleSolver_SAAtoASS ( lenA, angB, angA, NULL, NULL, &lenC ) ; + + return sgTriangleSolver_SAStoArea ( lenA, angB, lenC ) ; +} + void sgTriangleSolver_SSStoAAA ( SGfloat lenA, SGfloat lenB, SGfloat lenC, SGfloat *angA, SGfloat *angB, SGfloat *angC ) { @@ -1835,4 +1853,37 @@ if ( lenC ) *lenC = lenB * sgSin(angC) / sinB ; } } + +void sgTriangleSolver_ASStoSAA ( SGfloat angB, SGfloat lenA, SGfloat lenB, + SGfloat *lenC, SGfloat *angA, SGfloat *angC ) +{ + /* Sine law */ + + SGfloat aa = (lenB == SG_ZERO ) ? SG_ZERO : sgASin (lenA * sgSin(angB)/lenB) ; + + if ( angA ) *angA = aa ; + + /* Find the missing angle */ + + SGfloat cc = SG_180 - aa - angB ; + + if ( angC ) *angC = cc ; + + /* Use SAStoASA to get the last length */ + + sgTriangleSolver_SAStoASA ( lenA, cc, lenB, NULL, lenC, NULL ) ; +} + +void sgTriangleSolver_SAAtoASS ( SGfloat lenA, SGfloat angB, SGfloat angA, + SGfloat *angC, SGfloat *lenB, SGfloat *lenC ) +{ + /* Find the missing angle */ + + SGfloat cc = SG_180 - angB - angA ; + + if ( angC ) *angC = cc ; + + sgTriangleSolver_ASAtoSAS ( cc, lenA, angB, lenB, NULL, lenC ) ; +} + Index: sg.h =================================================================== RCS file: /cvsroot/plib/plib/src/sg/sg.h,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- sg.h 10 Jun 2002 03:46:52 -0000 1.32 +++ sg.h 10 Jun 2002 05:42:34 -0000 1.33 @@ -2571,22 +2571,36 @@ SGfloat sgTriangleSolver_ASAtoArea ( SGfloat angA, SGfloat lenB, SGfloat angC ); SGfloat sgTriangleSolver_SAStoArea ( SGfloat lenA, SGfloat angB, SGfloat lenC ); SGfloat sgTriangleSolver_SSStoArea ( SGfloat lenA, SGfloat lenB, SGfloat lenC ); +SGfloat sgTriangleSolver_ASStoArea ( SGfloat angB, SGfloat lenA, SGfloat lenB ); +SGfloat sgTriangleSolver_SAAtoArea ( SGfloat lenA, SGfloat angB, SGfloat angA ); + void sgTriangleSolver_SSStoAAA ( SGfloat lenA, SGfloat lenB, SGfloat lenC, SGfloat *angA, SGfloat *angB, SGfloat *angC ) ; void sgTriangleSolver_SAStoASA ( SGfloat lenA, SGfloat angB, SGfloat lenC, SGfloat *angA, SGfloat *lenB, SGfloat *angC ) ; void sgTriangleSolver_ASAtoSAS ( SGfloat angA, SGfloat lenB, SGfloat angC, SGfloat *lenA, SGfloat *angB, SGfloat *lenC ) ; +void sgTriangleSolver_ASStoSAA ( SGfloat angB, SGfloat lenA, SGfloat lenB, + SGfloat *lenC, SGfloat *angA, SGfloat *angC ) ;void sgTriangleSolver_SAAtoASS ( SGfloat lenA, SGfloat angB, SGfloat angA, + SGfloat *angC, SGfloat *lenB, SGfloat *lenC ) ; + SGDfloat sgdTriangleSolver_ASAtoArea(SGDfloat angA,SGDfloat lenB,SGDfloat angC); SGDfloat sgdTriangleSolver_SAStoArea(SGDfloat lenA,SGDfloat angB,SGDfloat lenC); SGDfloat sgdTriangleSolver_SSStoArea(SGDfloat lenA,SGDfloat lenB,SGDfloat lenC); +SGDfloat sgdTriangleSolver_ASStoArea(SGDfloat angB,SGDfloat lenA,SGDfloat lenB); +SGDfloat sgdTriangleSolver_SAAtoArea(SGDfloat lenA,SGDfloat angB,SGDfloat angA); + void sgdTriangleSolver_SSStoAAA(SGDfloat lenA,SGDfloat lenB, SGDfloat lenC, SGDfloat *angA,SGDfloat *angB,SGDfloat *angC ) ; void sgdTriangleSolver_SAStoASA(SGDfloat lenA,SGDfloat angB,SGDfloat lenC, SGDfloat *angA,SGDfloat *lenB,SGDfloat *angC ) ; void sgdTriangleSolver_ASAtoSAS(SGDfloat angA,SGDfloat lenB,SGDfloat angC, SGDfloat *lenA,SGDfloat *angB,SGDfloat *lenC ) ; +void sgdTriangleSolver_ASStoSAA(SGDfloat angB,SGDfloat lenA,SGDfloat lenB, + SGDfloat *lenC,SGDfloat *angA,SGDfloat *angC ) ; +void sgdTriangleSolver_SAAtoASS(SGDfloat lenA,SGDfloat angB,SGDfloat angA, + SGDfloat *angC,SGDfloat *lenB,SGDfloat *lenC ) ; #endif |