javascript - Paper.js distance between point and path - Stack Overflow

Is it possible to get distance between paper point and path? const point = new Point([100, 200]);const

Is it possible to get distance between paper point and path?

const point = new Point([100, 200]);
const path = new Path();

path.strokeColor = 'black';
path.add(new Point(30, 30));
path.add(new Point(100, 100));

Is it possible to get distance between paper point and path?

const point = new Point([100, 200]);
const path = new Path();

path.strokeColor = 'black';
path.add(new Point(30, 30));
path.add(new Point(100, 100));
Share Improve this question edited Nov 24, 2017 at 20:21 daniele3004 14k13 gold badges76 silver badges78 bronze badges asked Nov 23, 2017 at 10:03 Ewelina RybczyńskaEwelina Rybczyńska 312 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 10

point.getDistance(path.getNearestPoint(point)) will get you the distance between the point in question and the nearest point to it on the path.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745531512a4631716.html

相关推荐

  • javascript - Paper.js distance between point and path - Stack Overflow

    Is it possible to get distance between paper point and path? const point = new Point([100, 200]);const

    1天前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信