MCPcopy Create free account
hub / github.com/codecombat/codecombat / createQuadraticFunc

Function createQuadraticFunc

app/core/utils.js:716–716  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

714
715// f(x) = ax² + bx + c
716const createQuadraticFunc = params => x => ((params.a || 1) * x * x) + ((params.b || 1) * x) + (params.c || 0)
717
718// f(x) = a log(b (x + c)) + d
719const createLogFunc = params => function (x) { if (x > 0) { return ((params.a || 1) * Math.log((params.b || 1) * (x + (params.c || 0)))) + (params.d || 0) } else { return 0 } }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected