# Intersection of 3 sphere

Hello evvvvrybody,

I would like to know how to obtain the coordinates of the two points created by intersection of 3 sphere ?

Thanks for you help

PS: I think it will be a good idear to put on the vvvvorums the recipe of all the great food we ate during node festival… It was so delicious !

hi rogerlette

i would go that way:

we have 3 points A, B, C with spheres around them with radiuses r_a, r_b and r_c. a point P has to be on all 3 sphere surfaces to be an intersection point.

so how can we formulate that mathematically?
lets start with a try of describing the relationship of a point P on the surface of a sphere to the center A and radius r_a.

one solution would be to state that the radius r_a is just the distance from A to P (the point on the surface):

length (P - A) = r_a

the same is true for the other spheres (with same point P)

length (P - B) = r_b
length (P - C) = r_c

so we have 3 equations and 3 open variables P.x, P.y and P.z.

so it should be solvable that way.

length(d) = sqrt( d.xd.x + d.yd.y + d.z*d.z )

if we know that the radius r_a is positive we can skip the sqrt by sqr-ing the equation

d_a.xd_a.x + d_a.yd_a.y + d_a.zd_a.z = r_ar_a
with d_a = P - A

now it would be good to use a math program to solve the equations for P.x, P.y and P.z.

i started a plugin project here
http://vvvv.svn.sourceforge.net/viewvc/vvvv/plugins/c%23/Cut3Spheres/trunk/

note the math at the end of the file ;|
http://vvvv.svn.sourceforge.net/viewvc/vvvv/plugins/c%23/Cut3Spheres/trunk/Cut3Spheres.cs?revision=2198&view=markup

btw:
who knows of an open source alternative to mathematica?

Tanks you so mutch for this complete help,

But I’m a beginer so I understand the mathematic calcultion, but I dont know how to use the files you send.
When I try to open the .v4p it’s only display the iobox…

I read some stuff about complilation of the .sln but I dont know how to make it.

Please, could you explain how to make the plugin works?

the patch is still empty and also the plugin doesn’t do anything yet. i don’t know how much time i can spend into that. the calculation - if correct - however should have been already the most difficult part.
next step would be to solve the quadratic equation at the last line of the maths stuff.
you get 2 solutions for P.x.
after that you can compute the two solutions for P.y, P.z.
and you have your two points.

if you want to dive into compiling that plugin and trying out to translate maths into c# code here are some links which make it possible:
http://vvvv.org/tiki-index.php?page=HowTo+VVVVPlugins
http://vvvv.org/tiki-index.php?page=Version+Control+with+Subversion

first working version available
http://vvvv.svn.sourceforge.net/viewvc/vvvv/plugins/c%23/Cut3Spheres/trunk/

Hi Gregns,

I’m back in the vvvvworld after 3 weeks of travel in Vietnam.

I’m sorry for this late answer, thanks you again for your help, and for this available version.

But as I told you, I’m beginer and even if the node08 workshops have improved my poor skills in vvvv, I’m lost and afraid when you speak about plugin, .dll and all that strange stuff !

My question is simple, how to use the Cut3Spheres.dll ?

I’m sorry to disturbe you again for that kind of beginer question…

Hi

Please, is there anybody to help me…?

Rogerlette

hi rogerlette,

just drop the ddl into your patch.
and have a look at the help file. the only thing that is important is that the ddl file should be in a bin folder which should be located next to the help file (like in the directory structure at
http://vvvv.svn.sourceforge.net/viewvc/vvvv/plugins/c%23/Cut3Spheres/trunk/

so after downloading the help file and the ddl and placing them in the correct way next to each other you should be able to open the help file…

and there is more help.

Hi,

I’m sorry but it’s dont work for me, have have tried different stuff :

• Create a plugin folder in vvvv directory
• I create a bin folder inside
• I put the Cut3Spheres.dll in “bin” folder
• I put the help patch in the plugin folder
• I open the help, nothing appear
• I to drop the Cut3sheres.dll nothing appear

I also do the same in the bin folder or vvvv setup.
I also try put the help file in the same bin folder than the .dll
I also tryed to drop the .dll in a new vvvv patch after all this manipulation…

It’s should be easy as you said, but I dont succed, I’m sorry. Sometime I have an error , it’s in french so I try to translate for you :
The DLL application C:\Document…\Cut3spheres.dll is not valid

I hope it’s the last time I need your help,

Thanks you so mutch for your Help,

Rogerlette

helo roger,

• Create a plugin folder in vvvv directory
\plugins
directory containing some files. you need this latest version as it is the first and only so far that supports plugins at all.

so as greg describes in this dir you create a
\bin
directory where the .dll goes. the helppatch goes directly in the
\plugins
directory though. restart vvvv and start that helppatch.

if that doesn’t work you may not have installed the .net2.0 framework. a link to the download is on the beta16 startup-patch.

Hi joreg (and gregsn),

Thanks you for this help,

( Now I use the beta16 of V4 , I also install .net2.0 framework)

I can now open the help patch and I see the 3Spheres, but the plugin node not appear. I tried to drop the .dll in the patch but it’s dont works.

When drop the .dll of the Timeline (for example) it’s works well… So I thinks there is a problem with 3sphere.dll … Maybe it’s because I download it from Vietnam country…

I’m sorry to be so boring for easy things like this…

ic. downloading from those sourceforge pages is not so straighforward. you can easily get the wrong files. i attached the correct files below. those work for me.

Cut3Spheres.zip (5.6 kB)

Thanks you so mutch joreg for your help.

But it’s amazing, it’s dont work!!

I install again “vvvv_40beta16”
I install the last version of Direct X
I install net2.0 Frameworks

All my patch works well
The Help patch of timeliner,MultipleParticles and Lindenmayer works well and I can drag the .dll file in a new patch without any problem.

I create a “bin” folder (where I put the .dll) in the existing “plugins” folder.
I put the help patch directly in the “plugins” folder.
And it’s dont works, iven if I drag the .dll in the patch, or in a new patch.

I also try to keep the folder “bin” and “3spheres” you send me in the Cut3Spheres.zip file. It’s dont works too.

I dont know what to do now…I probably make a mistake but I cant find it.

There is no error, no bug…

really strange…

sory for my bad zipping. i attach a new .zip whose contents may be extracted to anywhere on disk and doubleclicking the helppatch will invoke the .dll lying next to it.

so this just for the archives, but it will probably not solve your problem. can you check if you get any message in the console? create a renderer tty and then drag the .dll on a patch. if the node does not appear at least an error message is supposed to appear in the console.

also, can anybody else see if this works? it works for me on 2 different pcs.

cut3spheres.zip (5.5 kB)

Hi,

I try again,I do exacly what you advice me, and I dont succed again…

I attach a screenshot of the renderer TTY when I start the patch and when I try to drag the .dll (3 last lines)

Thanks again,

v4RendrererTTY.JPG (78.7 kB)

HI,

Is anybody have an idea for this error?

It s write that is a problem of conversion from vvvv version :
vvvv33alpha9.0.dtd and vvvv40alpha.16.1.dtd
to version :
40beta16

But I dont know how to fix it? and I take the lastest version as you told me so I dont know how to make this patch works and I really need it.

Thanks again

do you have .NET 2.0 installed?

Hi,

Gregsn, Joreg and Kalle to solve my small begniner problem ! Thanks you so much to v4 community.

As I told to Gregsn in my last post ,

I install “vvvv_40beta16”
I install the last version of Direct X
I install net2.0 Frameworks

To be sure I install it again and I have exacly the same problem.

The really strange thinks is that its works well with other plugin… For eample, I just drop the .dll of timeliner for exaple, and the node appear correctly…

If you need, I can give you the access to control my computer from yours, in order to see exaclty whats happen on it…

I’m sorry,I dont know what to do…

helo roger,

me neither know what to try more. but can you try the same on a different pc? since it seems to work for everybody else and even for you with the other plugins…i really don’t know what the difference could be.

the conversion from 16.1 to 16 should not be related. that is only concerning the patch but since you say you cannot even drop the .dll on a new patch there seems to be something else going on.