I'm looking for a solution to a seemingly simple mathematical problem. Please refer to the attached drawing to illustrate the following description.
Given:
- A sphere with radius R = 1
- Two circles on the surface of this sphere, described by two arbitrary vectors A and B as well as two angles alphaA and alphaB (0..PI/2)
To calculate for the following seven cases:
1. Circles lie side by side and do not touch or intersect: - nothing -
2. Circles touch outside in one point: vector coords for this point C
3. Circles intersect each other: vector coords of the two points C1 and C2
4. Circles touch inside in one point: vector coords of this point C
5. Circles lie inside each other and do not touch or intersect: - nothing -
6. Circles are identical, with A = B and alphaA = alphaB: - nothing -
7. Circles are identical, with A = -B and alphaA = alphaB = PI/2: - nothing -
The drawing does show case #3.
In addition to a formal mathematical solution, I'm also looking for its implementation. This implementation should be numerically stable and in form of a function which accepts A, B, alphaA and alphaB as parameters and returns the case number as well as either zero, one or two points of intersection. Delphi would be prefered as programming language, but any similar will do (C, Java, VB etc.).
Hi, i have a solution for the intersecting circles which uses only 12 arithmetic and 9 vectorial operations to get the points. I can give you a Delphi solution.
$50 USD v 3 dnech
0,0 (0 recenze)
2,2
2,2
13 freelanceři nabízejí v průměru $82 USD za tuto práci
You have presented an interesting problem - I like the drawing ! I have a Mathematics degree and stacks of experience programming in C/C++/C# so I am confident I can do this. Do you want graphics output - or just a console application to report the result.
Hope to hear back !
Best regards
John Harris
(UK)
Hi,
I am a graduating student in International Institute of Information Technology, Hyderabad in India. I participate in many coding competitions.
I did so many problems in c & c++. I can do that code in c,c++ or any other programming language very easily.
Dear,
I'm expert in Math and liked this job.
I'd already solved the first 3 items.
As I'm in a Bussiness trip I don't have access to Delphi (I've it in my personal computer), but I can send you it implemented in MS Excel.
Best Regards,
Alexandre
On a 1.5 Ghz single core laptop, I am getting 5 seconds for 10,000,000 randomly generated pairs of circles and 55 seconds for 100,000,000. I assume it would run faster on your computer. The function is very simple, nothing fancy. If you're interested, I can just PM it to you.