Paper.js vector operation

北城余情 提交于 2019-11-29 10:57:43

Paper.js operator overloading for vector operations only works when you include the library with type="text/paperscript". Otherwise you have to use: add, subtract, multiply, divide, modulo, equals for +, -, *, /, % and ==.

like so:

point1.add([ 200, -50 ]);

or for your example:

radius: event.downPoint.subtract(event.point).length,

Here is your example with subtract and here are some more examples and tests.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!