Find Jobs
Hire Freelancers

Computing the point between two segments (3D)

$10-30 USD

已取消
已发布超过 9 年前

$10-30 USD

货到付款
I need someone for a very small job, I have to find the point resulting of two segments crossing in a 3D space. I found several method on the net and tried this one: D3DXVECTOR3 AB=B-A; D3DXVECTOR3 CD=D-C; D3DXVec3Normalize(&AB,&AB); D3DXVec3Normalize(&CD,&CD); if (D3DXVec3Dot(&AB,&CD)<0.01f) continue; float dx,dy,dz,c,d; dx=fabs(AB.x)+fabs(CD.x); dy=fabs(AB.y)+fabs(CD.y); dz=fabs(AB.z)+fabs(CD.z); if (dx>dz && dy>dz) //plan dx/dy { c=(AB.y*A.x+AB.x*C.y-AB.x*A.y-AB.y*C.x)/(AB.y*CD.x-AB.x*CD.y); d=(CD.y*C.x+CD.x*A.y-CD.x*C.y-CD.y*A.x)/(CD.y*AB.x-CD.x*AB.y); } else if (dx>dy && dz>dy) //plan dx/dz { c=(AB.z*A.x+AB.x*C.z-AB.x*A.z-AB.z*C.x)/(AB.z*CD.x-AB.x*CD.z); d=(CD.z*C.x+CD.x*A.z-CD.x*C.z-CD.z*A.x)/(CD.z*AB.x-CD.x*AB.z); } else if (dy>dx && dz>dx) //plan dy/dz { c=(AB.z*A.y+AB.y*C.z-AB.y*A.z-AB.z*C.y)/(AB.z*CD.y-AB.y*CD.z); d=(CD.z*C.y+CD.y*A.z-CD.y*C.z-CD.z*A.y)/(CD.z*AB.y-CD.y*AB.z); } //CX[nCX++] = ; V0=A+AB*c; V1=C+CD*d; V=V0-V1; if (D3DXVec3Length(&V)>PRECISION) continue; CX[nCX++]=V1; And it work but with a bad precision, with segments of 10 units long I have to set the PRECISION variable to 1 and the point is visualy not one the segments, just near. Then what I need is another method to find that point knowing segments are sometimes not perfectly on the same plane (but almost). I need the job done quickly (within 24hours max)
项目 ID: 6758379

关于此项目

3提案
远程项目
活跃9 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
3威客以平均价$52 USD来参与此工作竞价
用户头像
Hi! I am professional C/C++/C#/Java program,mer. I can do this project with highest quality. Best Regards, Szymszteinsl
$50 USD 在1天之内
4.9 (65条评论)
6.7
6.7
用户头像
Hello Sir... I have a very good experience in algorithms, geometry and math. Please contact me for details ASAP. Looking forward to work for you Sir. Best Regards.
$35 USD 在1天之内
4.9 (83条评论)
6.3
6.3
用户头像
Combination of programming and science. Sounds fun. I think I have an idea how to best solve this. Already worked something out.
$70 USD 在1天之内
0.0 (0条评论)
0.0
0.0

关于客户

FRANCE的国旗
Bourg de peage, France
5.0
52
付款方式已验证
会员自12月 23, 2003起

客户认证

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