Remap or Map function in Javascript

后端 未结 5 1975
小鲜肉
小鲜肉 2020-12-08 11:26

Of late, most of my programming experience has been in Processing, and more recently I have been wanting to branch out a little deeper in to some JavaScript, since they are

5条回答
  •  伪装坚强ぢ
    2020-12-08 11:44

    Here's an implementation of the Processing Math convenience methods in Javascript. It's a straight conversion of the original Processing Java source.

    p5.sq()
    p5.constrain()
    p5.degrees()
    p5.mag()
    p5.dist()
    p5.lerp()
    p5.norm()
    p5.map()
    

    Get the code from here: https://github.com/trembl/p5.Math.js/

提交回复
热议问题