<!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
<stack>
<name>in</name>
<id>-1</id>
<cardCount>1</cardCount>
<cardID>2922</cardID>
<listID>3954</listID>
<cantModify><false /></cantModify>
<cantDelete><false /></cantDelete>
<cantAbort><false /></cantAbort>
<cardSize>
<width>512</width>
<height>342</height>
</cardSize>
<script>on hcoftpfgestaltxxx r,x-- this handler should go in every HC of 2.5 extension stackif r <> (the short name of me) thensend "hcoftpfgestaltxxx" && quote & r & quote & "," & quote & x & quote to stack "KHyX"put the result into xxxreturn xxxend ifif x = "getFunctions" thenput "sec csc cot sinh cosh tanh coth sech csch asin acos acot asec acsc " into tput "asinh acosh atanh acoth asech acsch newsqrt root newroot cbrt newcbrt log10 " after tput "naturallogarithm naturalexponential naturalmulog naturaldivlog naturalpowelog " after tput "binarylogarithm binaryexponential binarymulog binarydivlog binarypowelog " after tput "commonlogarithm commonexponential commonmulog commondivlog commonpowelog " after tput "anylog anyexp recip square cube intgr decml e itothei goldenratio infinitesimal infinity " after tput "addendial subtrahendial factorial dividendial factorsum factorproduct zeta " after tput "baseconvertreal realnumberfromanybasetodecimal realnumberfromdecimaltoanybase " after tput "radius theta xcoord ycoord complexNumbers cn " after tput "cpxadd cpxsub cpxmul cpxdiv cpxintdiv cpxmod " after tput "cpxpower cpxexp cpxlog cpxsqrt cpxroot " after tput "cpxabs cpxsgn cpxsin cpxcos cpxtan cpxrecip cpxstrtoval cpxvaltostr " after tput "angleconvert tempconvert lengthconvert areaconvert volumeconvert bytesizeconvert " after tput "rectangleperimeter rectanglearea " after tput "circlecircumference circlearea trianglearea trapezoidarea " after tput "cubesurface cubevolume prismvolume cylindervolume conevolume " after tput "binaryand binaryor binaryxor binarynot noise bool sgn saw tri squ shrinknumber " after tput "randomrange randomdecimal nantonum nantonumeng isprime iscomposite issquare " after tput "istriangular isperfect isabundant isdeficient ishappy ispalindromic " after tput "isodd iseven ispositive isnegative theperfectness thepolarity " after tput "superosesin superosecos superosetan " after tput "lissajoussin lissajouscos lissajoustan conchshellsin conchshellcos" after treturn tend ifif x = "getGestaltFunctions" thenput empty into tput "getVersion getHandlers getFunctions getGestaltFunctions" after treturn tend ifif x is empty then return trueif x = "getVersion" then return "3.5"if x = "getHandlers" then return "hcoftpfgestaltxxx HCofTPFloadStack"end hcoftpfgestaltxxxon HCofTPFloadStackput word 2 of the long name of me into xxdelete last char of xxdelete first char of xxput the itemdelimiter into oset the itemdelimiter to ":"delete last item of xxset the itemdelimiter to oput ":HyperMath Extension Settings" after xxopen file xxread from file xx until eofclose file xxput it into xtenlistrepeat with x = 1 to the number of lines in xtenlistif line x of xtenlist is not empty thenput line x of xtenlist into trepeat with z = (the number of chars in t) down to 1if char z of t is space then delete char z of tend repeatput "HM" before tstart using stack tend ifend repeatend HCofTPFloadStackfunction csc xreturn 1/sin(x)end Cscfunction sec xreturn 1/cos(x)end Secfunction cot xreturn 1/tan(x)end Cotfunction sinh xreturn (exp(2*x)-1)/(2*exp(x))end Sinhfunction cosh xreturn (exp(2*x)+1)/(2*exp(x))end Coshfunction tanh xreturn (exp(2*x)-1)/(exp(2*x)+1)end Tanhfunction asin xreturn atan(x/sqrt(-x*x+1))end asinfunction acos xreturn -atan(x/sqrt(-x*x+1))+pi/2end acosfunction asinh xreturn ln(x+sqrt((x^2)+1))end Asinhfunction acosh xreturn ln(x+sqrt((x^2)-1))end Acoshfunction atanh xreturn .5*(ln((1+x)/(1-x)))end Atanhfunction asec xreturn atan(x/sqrt(x*x-1))end asecfunction acsc xreturn atan(x/sqrt(x*x-1))+(sgn(x)-1*pi/2)end acscfunction acot xreturn atan(x)+pi/2end acotfunction sech xreturn 2/(exp(x)+exp(-x))end sechfunction csch xreturn 2/(exp(x)-exp(-x))end cschfunction coth xreturn (exp(-x)/exp(x))-(exp(-x))*2+1end cothfunction asech xreturn ln(sqrt(-x*x+1)+1/x)end asechfunction acsch xreturn ln(sgn(x)*sqrt(x*x+1/x))end acschfunction acoth xreturn ln((x+1)/(x-1))/2end acothfunction SuperoseCOS x,a,efreturn sin(ef*x)*cos(a*x)end SuperoseCOSfunction SuperoseSIN x,a,efreturn sin(ef*x)*sin(a*x)end SuperoseSINfunction SuperoseTAN x,a,efreturn sin(ef*x)*tan(a*x)end SuperoseTANfunction LissajousCOS x,areturn cos(a*x)end LissajousCOSfunction LissajousSIN x,areturn sin(a*x)end LissajousSINfunction LissajousTAN x,areturn tan(a*x)end LissajousTANfunction ConchShellSIN xreturn sin(x)*x*xend ConchShellSINfunction ConchShellCOS xreturn cos(x)*x*xend ConchShellCOSfunction noise xif x is not empty thenreturn (x*((random(1000000)/1000000)+1))/2elsereturn ((random(1000000)/1000000)+1)/2end ifend noisefunction bool iif not (i is in "true%false%on%off%yes%no%up%down%1%0") then return -1if (i is in "true%on%yes%down%1") then return 1return 0end boolfunction NANtoNUM xif x = 1 then return "complex" -- y竏噎 or asin(x)/acos(x) resulting in complexif x = 33 then return "ind" -- sin(INF), cos(INF), etc.if x = 36 then return "complex" -- log(-x), a***h(-x)if x = 37 then return "complex" -- x^y resulting in complex, 1^INFif x = 0 then return "ind" -- 0/0, 0*INF, INF/INF, INF-INFif x = 255 then return "undef"repeat while the number of chars in x <> 3put "0" before xend repeatreturn "NAN(" & x & ")"end NANtoNUMfunction NANtoNUMeng xif x = 1 then return "a complex number (use complexNumbers function)"if x = 33 then return "an indeterminate (running around in circles)"if x = 36 then return "a complex number (use complexNumbers function)"if x = 37 then return "a complex number (use complexNumbers function)"if x = 0 then return "an indeterminate (choose from infinitely many answers)"if x = 255 then return "(the function needed a positive integer)"return "an unexpected result"end NANtoNUMengfunction zeta x-- WARNING!!! For values of x less than 3, calculation may take a LONG time!if (x < 0) and (round(x/2) = x/2) then return 0put 0 into aput 0 into bput 0 into irepeatadd 1 to iadd 1/(i^x) to bif a=b then exit repeatput b into aend repeatreturn bend zetafunction shrinknumber xif x = "INF" then return 1if x = "-INF" then return -1if x > 1 then put 2-(1/x) into xif x < -1 then put (-2)+((-1)/x) into xreturn x/2end shrinknumberfunction saw nreturn (atan(tan(n*(pi/2))))/(pi/2)end sawfunction tri nreturn (asin(sin(n*(pi/2))))/(pi/2)end trifunction squ nput (sin(n*(pi/2))) into xif x > 0 then return 1if x < 0 then return -1if x = 0 then return 1end squfunction NaturalLogarithm xreturn ln(x)end NaturalLogarithmfunction BinaryLogarithm xreturn log2(x)end BinaryLogarithmfunction CommonLogarithm xreturn (ln(x)/ln(10))end CommonLogarithmfunction NaturalExponential xreturn exp(x)end NaturalExponentialfunction BinaryExponential xreturn 2^xend BinaryExponentialfunction CommonExponential xreturn 10^xend CommonExponentialfunction NaturalMulog n,xreturn (exp(ln(abs(n))*ln(abs(x))))*sgn(n)*sgn(x)end Naturalmulogfunction NaturalDivlog n,xreturn (exp(ln(abs(n))/ln(abs(x))))*sgn(n)*sgn(x)end NaturalDivlogfunction NaturalPowelog n,xreturn (exp(ln(abs(n))^ln(abs(x))))*sgn(n)*sgn(x)end Naturalpowelogfunction BinaryMulog n,xreturn (2^(log2(abs(n))*log2(abs(x))))*sgn(n)*sgn(x)end BinaryMulogfunction BinaryDivlog n,xreturn (2^(log2(abs(n))/log2(abs(x))))*sgn(n)*sgn(x)end BinaryDivlogfunction BinaryPowelog n,xreturn (2^(log2(abs(n))^log2(abs(x))))*sgn(n)*sgn(x)end BinaryPowelogfunction CommonMulog n,xreturn (10^(log10(abs(n))*log10(abs(x))))*sgn(n)*sgn(x)end CommonMulogfunction CommonDivlog n,xreturn (10^(log10(abs(n))/log10(abs(x))))*sgn(n)*sgn(x)end CommonDivlogfunction CommonPowelog n,xreturn (10^(log10(abs(n))^log10(abs(x))))*sgn(n)*sgn(x)end CommonPowelogfunction log10 xreturn commonlogarithm(x)end log10function anylog base,nreturn ln(n)/ln(base)end anylogfunction anyexp base,nreturn base^nend anyexpfunction factorSum xif x < 1 then return 0if intgr(x) <> x then return 0put intgr(sqrt(x)) into sput 0 into trepeat with z = 1 to sif (x/z) = (x DIV z) thenadd z to tadd (x/z) to tend ifend repeatreturn tend factorSumfunction factorProduct xif x < 1 then return 0if intgr(x) <> x then return 0put intgr(sqrt(x)) into sput 1 into trepeat with z = 1 to sif (x/z) = (x DIV z) thenmultiply t by zmultiply t by (x/z)end ifend repeatreturn tend factorProductfunction factorial xif x = 0 then return 1if x < 1 then return "NAN(255)"if intgr(x) <> x then return "NAN(255)"put 1 into yrepeat with z = 1 to xmultiply y by zend repeatreturn yend factorialfunction addendial xif x = 0 then return 1if x < 1 then return "NAN(255)"if intgr(x) <> x then return "NAN(255)"put 0 into yrepeat with z = 1 to xadd z to yend repeatreturn yend addendialfunction dividendial xif x < 1 then return "NAN(255)"if intgr(x) <> x then return "NAN(255)"return 1/factorial(x)end dividendialfunction subtrahendial xif x < 1 then return "NAN(255)"if intgr(x) <> x then return "NAN(255)"return 1-addendial(x)end subtrahendialfunction radius x,yreturn sqrt((x^2)+(y^2))end radiusfunction theta x,yif x>0 then return atan(y/x)if x<0 then return atan(y/x)-(pi/2)if x=0 thenif y>0 then return (pi/2)if y<0 then return (pi/(-2))if y=0 then return 0end ifend thetafunction xcoord r,thetareturn r*cos(theta)end xcoordfunction ycoord r,thetareturn r*sin(theta)end ycoordfunction infinitesimalput ((the number of chars in (pi+0))-3) into aput "0." into brepeat aput "0" after bend repeatput "1" after breturn b*1end infinitesimalfunction root n,rreturn n^(1/r)end rootfunction newSqrt xreturn sqrt(abs(x))*sgn(x)end newSqrtfunction newRoot n,rreturn root(abs(x),r)*sgn(x)end newrootfunction recip xreturn 1/xend recipfunction cbrt xreturn x^(1/3)end cbrtfunction newCbrt xreturn newRoot(x,3)end newCbrtfunction square xreturn x^2end squarefunction cube xreturn x^3end cubefunction intgr xreturn x DIV 1end intgrfunction decml xreturn x MOD 1end decmlfunction ereturn exp(1)end efunction goldenratioreturn (1+sqrt(5))/2end goldenratiofunction itotheireturn exp(-pi/2)end itotheifunction sgn xif x = 0 then return 0if x < 0 then return -1if x > 0 then return 1end sgnfunction randomRange x,yreturn random((y-x)+1)+(x-1)end randomRangefunction randomDecimalreturn random(100000000)/100000000end randomDecimalfunction infinityreturn (1/0)end infinityfunction rectangleperimeter a,breturn a+a+b+bend rectangleperimeterfunction rectanglearea a,breturn a*bend rectangleareafunction cubesurface a,b,creturn (a*b + a*c + b*c) * 2end cubesurfacefunction cubevolume a,b,creturn a*b*cend cubevolumefunction circlecircumference rreturn pi*r*2end circlecircumferencefunction circlearea rreturn pi*(r^2)end circleareafunction spherevolume rreturn (4/3)*pi*(r^3)end spherevolumefunction trianglearea b,hreturn (b*h)/2end triangleareafunction trapezoidarea a,b,hreturn ((a+b)*h)/2end trapezoidareafunction prismvolume b,h,lreturn (b*h*l)/2end prismvolumefunction cylindervolume r,lreturn pi*(r^2)*lend cylindervolumefunction conevolume r,hreturn (pi*(r^2)*h)/3end conevolumefunction polyxcoord x,n,r-- x coordinate of point x of an n-sided polygon with a radius of rreturn (cos(2*pi*(x/n))*r) div 1end polyxcoordfunction polyycoord x,n,r-- y coordinate of point x of an n-sided polygon with a radius of rreturn (sin(2*pi*(x/n))*r) div 1end polyycoord</script>