Find Jobs
Hire Freelancers

Computing the point between two segments (3D)

$10-30 USD

Cancelled
Posted over 9 years ago

$10-30 USD

Paid on delivery
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)
Project ID: 6758379

About the project

3 proposals
Remote project
Active 9 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
3 freelancers are bidding on average $52 USD for this job
User Avatar
Hi! I am professional C/C++/C#/Java program,mer. I can do this project with highest quality. Best Regards, Szymszteinsl
$50 USD in 1 day
4.9 (65 reviews)
6.7
6.7
User Avatar
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 in 1 day
4.9 (83 reviews)
6.3
6.3
User Avatar
Combination of programming and science. Sounds fun. I think I have an idea how to best solve this. Already worked something out.
$70 USD in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of FRANCE
Bourg de peage, France
5.0
52
Payment method verified
Member since Dec 23, 2003

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.