Category talk:Wren-math: Difference between revisions
Content added Content deleted
(→Source code: Changed name of just added isRoot method to isPower) |
(→Source code: Added Math.lerp method) |
||
Line 65: | Line 65: | ||
// Convenience version of above method which uses 0 for the 'mode' parameter. |
// Convenience version of above method which uses 0 for the 'mode' parameter. |
||
static toPlaces(x, p) { toPlaces(x, p, 0) } |
static toPlaces(x, p) { toPlaces(x, p, 0) } |
||
// Returns the linear interpolation of t between x and y, if t is in [0, 1] or |
|||
// linear extrapolation otherwise. |
|||
static lerp (x, y, t) { x + t * (y - x) } |
|||
// The power of 'p' which equals or first exceeds a non-negative number 'x'. |
// The power of 'p' which equals or first exceeds a non-negative number 'x'. |