Math

ACos Funct Arc Cos (Inverse Cos). ASin Funct Arc Sin (Inverse Sin). ATan Funct Repeated write U32 to I/O port. Abs Funct Repeated write U8 to I/O port. AbsI64 Funct Repeated write U8 to I/O port. Arg Funct Swap two U8s. Not atomic. Caw Funct Cawtooth. 1.0 - 0.0 think "(Cos+1)/2" Ceil Funct Tangent. CeilI64 Funct Int multiples of num. CeilU64 Funct Int multiples of num. Clamp Funct Clamp to F64 [] range. ClampI64 Funct Convert to F64. ClampU64 Funct Polar coordinate angle. Cos Funct Arc Tan (Inverse Tan). Cosh Funct Hyperbolic Cosine. DistSqrI64 Funct Distance-squared between 2 points. Exp Funct Ceiling of F64. Floor Funct Clamp to U64 [] range. FloorI64 Funct Int multiples of num. FloorU64 Funct Int multiples of num. FullCaw Funct Plus&Minus Cawtooth. 1.0 - -1.0 think "Cos" FullSaw Funct Plus&Minus Sawtooth. 1.0 - -1.0 think "Sin" FullTri Funct Plus&Minus Triangle waveform. 0.0 - 1.0 - 0.0 - -1.0 -0.0 Ln Funct _extern _FCLEX U0 Fclex(); Log10 Funct _extern _FLDCW U0 Fldcw(U16 w); Log2 Funct Floor of F64. Max Funct Max of two F64s. MaxI64 Funct Arc Tan (Inverse Tan). MaxU64 Funct Arc Tan (Inverse Tan). Min Funct Min of two F64s. MinI64 Funct Absolute F64. MinU64 Funct Absolute I64. ModU64 Funct Cosine. P2R Funct Polar to Rect Pow Funct _extern _FSTCW U16 Fstcw(); Pow10 Funct _extern _FSTSW U16 Fstsw(); Pow10I64 Funct F64 int powers of ten. R2P Funct Rect to polar Rand Funct Random F64. RandI16 Funct Random I16. RandI32 Funct Random I32. RandI64 Funct Random I64. RandRange Funct Returns a random integer in [min,max], biased, but fast RandRangeSeed Funct Returns a reproducibly random integer in [min,max] RandU16 Funct Random U16. RandU32 Funct Random U32. RandU64 Funct Random U64. Round Funct Logarithm. RoundI64 Funct Int multiples of num. Saw Funct Sawtooth. 0.0 - 1.0 think "(Sin+1)/2" Seed Funct Set Rand() seed. Zero for timer-based. Sign Funct Log base 10. SignI64 Funct Max of two I64s. Sin Funct Max of two U64s. Sinh Funct Hyperbolic Sine. Sqr Funct Min of two I64s. SqrI64 Funct Min of two U64s. SqrU64 Funct Div and return U64 Modulo. Sqrt Funct Sign of I64: -1,0,1. SwapI64 Funct Square of F64. SwapU16 Funct Square of U64. SwapU32 Funct Swap two I64s. Not atomic. SwapU8 Funct Swap two U16s. Not atomic. Tan Funct Swap two U16s. Not atomic. ToBool Funct Swap two U32s. Not atomic. ToF64 Funct Swap two U32s. Not atomic. ToI64 Funct Swap two U8s. Not atomic. Tri Funct Triangle waveform. 0.0 - 1.0 - 0.0 Trunc Funct Log base 2. Wrap Funct Returns angle in range [base,base+2*pi)

Math/CD3

TempleOS has a class for 3 dimensional points consisting of F64s. HolyC is not C++ -- it does not support passing or returning values from functions which are not 64-bits, therefore, it can't be implemented with operator overloading. Making all function args and returns 64-bit is a core prinicple of TempleOS. As a courtesy, most of the CD3 functions return the addr of the destination vect, so you can nestle calls. They do not alloc new space for the destination vect. CD3 Class Three dimensional F64 pt D3Add Funct Sign of F64: -1,0,1 D3AddEqu Funct Truncate F64. D3Copy Funct #help_index "Math/CD3;Data Types/CD3" D3Cross Funct #help_index "Math/CD3;Data Types/CD3" D3Dist Funct sum=d1+d2 D3DistSqr Funct sum=d1+d2 D3Div Funct sum+=d D3DivEqu Funct dst=src D3Dot Funct prod=d1xd2 D3Equ Funct Distance Squared D3Mul Funct quot=d/s D3MulEqu Funct quot/=s D3Norm Funct d1 dot d2 D3NormSqr Funct dst=(x,y,z) D3Sub Funct dst=(x,y,z) D3SubEqu Funct prod=s*d D3Unit Funct prod*=s D3Zero Funct Norm

Math/Complex

CAdd Funct sum=n1+n2 CCopy Funct dst=src CDiv Funct quot=n1/n2 CEqu Funct dst=(x,y) CMul Funct prod=n1*n2 CPoly Funct Eval complex polynomial CScale Funct dst*=s CSub Funct diff=n1-n2 Complex Class class Complex NextPow2 Funct Get next power of 2 >= input

Math/Data Types

CD2 Class Two dimensional F64 pt CD2I32 Class Two dimensional I32 pt CD2I64 Class Two dimensional I64 pt CD3I64 Class Three dimensional I64 pt

Math/Data Types/D3I32

CD3I32 Class Three dimensional I32 pt CQueD3I32 Class Que of three dimensional I32 pts D3I32Dist Funct Distance D3I32DistSqr Funct Distance Squared D3I32Norm Funct Norm D3I32NormSqr Funct Norm Squared

Math/ODE

TempleOS has an advanced algorithm for integrating ordinary differential equations suitable for use in video games. (Not scientific work.) It also has some support for systems of masses and springs, to save you some work. See CMathODE and ODEsUpdate for an overview. See ODECallDerivative to see what support there is for masses and springs. See ::/Demo/Games/Whap.HC, ::/Demo/Games/Rocket.HC, ::/Demo/Games/MassSpring.HC, ::/Apps/Span/SpanMain.HC or ::/Apps/X-Caliber/X-Caliber.HC. CMass Class class CMass CMathODE Class class CMathODE COrder2D3 Class class COrder2D3 CSpring Class class CSpring MassFind Funct Search for mass nearest to x,y,z. MassFindNum Funct Return mass number N. MassOrSpringFind Funct Find spring or mass nearest x,y,z. ODEDel Funct Free ODE node, but not masses or springs. ODENew Funct Make differential equation ctrl struct. See flags. ODEPause Funct Pause ODE. ODERenum Funct Renumber masses and springs. ODERstInactive Funct Set all masses and springs to ACTIVE for new trial. ODESize Funct Mem size of ode ctrl, but not masses and springs. SpringFind Funct Find spring midpoint nearest x,y,z.