mbr,
@mbr@mastodon.gamedev.place avatar

On twitter @sebbbi mentions a cheap approximation of sin(π x) on [-1,1]

sin(π x)/4 ≈ x - x |x|

Normally if we want a two term approximation of an odd function we're stuck with the form:

a(x) = c₁ x + c₃ x³

but if we move away from pure polynomials then another two term form is possible:

b(x) = k₁ x + k₂ x |x|

and this generalizes to however many term odd/even function approximations (filling in otherwise skipped powers with one as abs which spit into two subexpressions w & w/o abs)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • anitta
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • provamag3
  • tester
  • Leos
  • megavids
  • JUstTest
  • All magazines