Update of /cvsroot/plib/plib/doc/sg
In directory usw-pr-cvs1:/tmp/cvs-serv19464/plib/doc/sg
Modified Files:
index.html
Added Files:
triangle_params.png
Log Message:
Added a diagram to the documentation and
new functions for Angle/Side/Side and Side/Side/Angle.
--- NEW FILE: triangle_params.png ---
(This appears to be a binary file; contents omitted.)
Index: index.html
===================================================================
RCS file: /cvsroot/plib/plib/doc/sg/index.html,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- index.html 10 Jun 2002 03:46:52 -0000 1.11
+++ index.html 10 Jun 2002 05:42:33 -0000 1.12
@@ -184,12 +184,25 @@
sides and included angle, find length of remaining side")...
nope - neither do I. That's why these functions are useful.
<p>
+<TABLE>
+<TR>
+<TD>
NOTE:
<ul>
<li> SSS = Three sides.
<li> SAS = Two sides and the angle between them.
<li> ASA = Two angles and the side between them.
+<li> SAA = One side and two angles that don't include it.
+<li> ASS = Two sides and one angle that's not between them.
+<li> lenA, lenB, lenC = The lengths of sides A, B and C.
+<li> angA, angB, angC = The angles opposite sides A, B and C.
</ul>
+</TD>
+<TD>
+<center><IMG SRC="triangle_params.png"></center>
+</TD>
+</TR>
+</TABLE>
<pre>
void sgTriangleSolver_SSStoAAA ( SGfloat lenA, SGfloat lenB, SGfloat lenC,
@@ -198,29 +211,35 @@
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 ) ;
</pre>
-Imagine an arbitary triangle with sides of length 'lenA', 'lenB', 'lenC'
-and angles 'angA', 'angB' and 'angC' where angA is opposite the side of
-length lenA - and so on.
-<p>
These functions take three parameters which are a mixture of lengths and angles
-for an arbitary triangle. They return the missing three lengths
-or angles. In all cases of 'funny' triangles
-(zero angles, zero lengths, impossible triangles), the package comes
-up with one plausible result - or all zeroes. If one or more of the
-results are not needed, pass a NULL pointer for the result and the
-package can avoid doing the unnecessary trig.
+for an arbitary triangle. They return the missing three parameters.
+In all cases of 'degenerate' triangles (eg zero angles, zero lengths), the
+package comes up with a plausible result - although it may not be a unique
+solution. This should be robust and more roundoff-error-tolerant than
+producing an error return.
+<p>
+Impossible triangles will produce all-zero results.
+<p>
+If one or more of the results are not needed, pass a NULL pointer for it
+and the package can avoid doing the unnecessary trig and perhaps run a
+little faster.
<pre>
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 ) ;
</pre>
-These compute the area of a triangle from three sides, two angles and
-included side or two sides and included angle - impossible triangles
-return areas of zero.
+These compute the area of a triangle from three parameters. Impossible
+triangles (eg lenA > lenB+lenC) return zero areas.
<H3>sgCoord</H3>
This simple structure contains two members - each of type
'sgVec3' - the first is 'xyz', the second 'hpr' - and together,
|