Math

ACos Funct Arc Cos (Inverse Cos). ASin Funct Arc Sin (Inverse Sin). ATan Funct Repeated write U8 to I/O port. Abs Funct Repeated write U8 to I/O port. AbsI64 Funct Arc Tan (Inverse Tan). Arg Funct Tangent. Caw Funct Cawtooth. 1.0 - 0.0 think "(Cos+1)/2" Ceil Funct Convert to Boolean. CeilI64 Funct Int multiples of num. CeilU64 Funct Int multiples of num. Clamp Funct Clamp to F64 [] range. ClampI64 Funct Convert to I64. Truncates. ClampU64 Funct Ceiling of F64. Cos Funct Arc Tan (Inverse Tan). Cosh Funct Hyperbolic Cosine. DistSqrI64 Funct Distance-squared between 2 points. Exp Funct Clamp to I64 [] range. 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 _FLDCW U0 Fldcw(U16 w); Log10 Funct Floor of F64. Log2 Funct _extern _FSTCW U16 Fstcw(); Max Funct Max of two F64s. MaxI64 Funct Arc Tan (Inverse Tan). MaxU64 Funct Absolute F64. Min Funct Min of two F64s. MinI64 Funct Absolute I64. MinU64 Funct Cosine. ModU64 Funct Max of two I64s. P2R Funct Polar to Rect Pow Funct _extern _FSTSW U16 Fstsw(); Pow10 Funct Logarithm. 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 Log base 10. 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 2. SignI64 Funct Max of two U64s. Sin Funct Min of two I64s. Sinh Funct Hyperbolic Sine. Sqr Funct Min of two U64s. SqrI64 Funct Div and return U64 Modulo. SqrU64 Funct Sign of I64: -1,0,1. Sqrt Funct Sine. SwapI64 Funct Square of I64. SwapU16 Funct Square head of F64. SwapU32 Funct Swap two I64s. Not atomic. SwapU8 Funct Swap two U16s. Not atomic. Tan Funct Swap two U32s. Not atomic. ToBool Funct Swap two U32s. Not atomic. ToF64 Funct Swap two U8s. Not atomic. ToI64 Funct Swap two U8s. Not atomic. Tri Funct Triangle waveform. 0.0 - 1.0 - 0.0 Trunc Funct F64 base to a power. 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 Truncate F64. D3AddEqu Funct #help_index "Math/CD3;Data Types/CD3" D3Copy Funct #help_index "Math/CD3;Data Types/CD3" D3Cross Funct sum=d1+d2 D3Dist Funct sum=d1+d2 D3DistSqr Funct sum+=d D3Div Funct dst=src D3DivEqu Funct prod=d1xd2 D3Dot Funct Distance D3Equ Funct quot=d/s D3Mul Funct quot/=s D3MulEqu Funct d1 dot d2 D3Norm Funct dst=(x,y,z) D3NormSqr Funct dst=(x,y,z) D3Sub Funct prod=s*d D3SubEqu Funct prod*=s D3Unit Funct Norm D3Zero Funct Norm Squared

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

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.