HP Forums
(50g) osculating circle - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (50g) osculating circle (/thread-5392.html)



(50g) osculating circle - peacecalc - 12-22-2015 08:36 PM

Hello all,

The power of the HP 50g can be seen in that little program for calculating the coordinates of the center of the osculating circle and the radius r for 2-dimensional plane slopes. Which can be described by functions. The function is defined in the variable "FN".

I used the formulas:

\[ x_M = x - f'(x)\cdot\frac{1+ f'(x)^2}{f''(x)} \]

\[ y_M = f(x) + \frac{1+ f'(x)^2}{f''(x)} \]

\[ r = \frac{\sqrt{1+ f'(x)^2}^3}{f''(x)} \]

Code:

%%HP: T(3)A(R)F(,);
\<< 'X' 0 DUPDUP                   @@intial values
    \-> X0 F0 F1 F2                @@for this variables     
        \<< X0 FN DUP              @@the function f is defined in "FN"
           'F0' STO                @@the symbolic term of f is stored
                                   @@F0 
           DERVX DUP               @@first derivate is stored 
           'F1' STO                @@in F1
           DERVX                   @@second derivate is stored
           'F2' STO                @@in F2 
           F1 SQ 1 + DUP F2 / DUP  @@calculating x-coordinate 
           F1 * NEG X0 +           @@curvature circle
           SIMPLIFY "XM" \->TAG 
           SWAP F0 +               @@calculating y-coordinate
           SIMPLIFY "YM" \->TAG    @@curvature circle
           ROT '3/2' ^ F2 / ABS    @@calculating radius r of
           "R" \->TAG              @@ curvature circle
  \>>
\>>

For example: FN contains \<< \-> X \<< X 2 ^ \>> \>> you get as result:

\[ XM:\ \ - (4*X^3) \]
\[ YM:\ \ \frac{6*X^2+1}{2} \]
\[ R:\ \ \frac{\sqrt{4*X^2+1}^3}{2} \]

Feel free and enjoy the little program!
Every constructive critics or suggestions for improvement are welcome.

Greetings peacecalc