Your calculation() function seems to only be defined in the scope of the draw() function. So When you call it outside of the draw function, it does not exist.
Your calculation() function seems to only be defined in the scope of the draw() function. So When you call it outside of the draw function, it does not exist.