Find Jobs
Hire Freelancers

JavaScript - math - geometry - find zigzag line length

$30-250 USD

已完成
已发布将近 11 年前

$30-250 USD

货到付款
I have a zigzag line defined by array of [x,y] points, like: var points = [ [50,100], [200,120], [40,200], [50,400] ]; This line is drawn on the screen as SVG path. Later, mouse cursor is traveling on the screen near the line, and I need to be able to say at which LENGTH the mouse cursor is within the path. I may have many different zigzag lines, so I need an universal solution. I need you to write function getLengthAtPoint() in javascript. The function will accepts three input arguments - first is the array of point coordinates, which describe the zigzag line. Second and third parameters are x and y position of the mouse cursor on the screen. The mouse cursor coordinates doesn't need to be on the line itself, in fact it may be anywhere on the screen, in that case the result will be approximate. But the nearest the cursor is to the line, the more precision I need. Your goal is to find out which point on the zigzag line is the most nearest to the mouse cursor's x-y coordinates and what is the total LENGTH of the zigzag line from the starting coordinate to the point. You can see demo here: [login to view URL] As you can see, if you hover your mouse above the first part of the zigzag line, it works (it shows the red circle right under the mouse). But it doesn't work for the rest of the path. Your goal is to fix getLengthAtPoint() function so it works within the whole zigzag path.
项目 ID: 4580290

关于此项目

4提案
远程项目
活跃11 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
颁发给:
用户头像
Hello again Tomas, we worked on a previous project together I believe. I'm fairly confident I would be able to knock out this project as well for you by tonight.
$69 USD 在0天之内
5.0 (9条评论)
3.9
3.9
4威客以平均价$126 USD来参与此工作竞价
用户头像
Hi i am recently worked raphaeljs. my code is work properly rest of path... i will do rest of path
$210 USD 在3天之内
4.9 (12条评论)
4.0
4.0
用户头像
Hi, I will complete it within 2 hours of awarding the project. Thanks
$35 USD 在3天之内
5.0 (2条评论)
2.0
2.0
用户头像
sir, I have science and math background and a computer savvy as well. Consider me for this project.
$205 USD 在3天之内
0.0 (0条评论)
0.0
0.0
用户头像
10+ years expirience with javascript
$55 USD 在1天之内
0.0 (0条评论)
0.0
0.0

关于客户

CZECH REPUBLIC的国旗
Sumperk, Czech Republic
5.0
67
付款方式已验证
会员自4月 5, 2009起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。