math constant
Problem it solves
You need a mathematical constant like π or e in a calculation without typing out a long decimal from memory.
What this block does
Returns a common mathematical constant: NaN, π, e, LN2, LN10, √1/2, or √2.
The block
Block ID: spriteutilmathconsts
Parameters
| Name | Type | Default | Meaning |
|---|---|---|---|
| constType | Consts | — | Which constant to return |
Returns
number — The value of the selected constant.
Example
let pi = spriteutils.consts(spriteutils.Consts.Pi) console.log(pi)
Add the extension
Add github:jwunderl/arcade-sprite-util to your project, or open: Import arcade-sprite-util.