Say I have three points [0,0] [30,20] [25,5]
How can I find the center and radius of the circle?
I'm having a tough time wrapping my head around the math for it.
http://www.had2know.com/academics/c...reepoints.html


Login register 
Thread Closed share thread  « Previous Thread  Next Thread » 

Thread Tools  Search this Thread  Display Modes 
06172013, 10:58 PM  #1 
Expert
portfolio
John Martini
CG Supervisor, 3D, Maxscript, VFX
Ingenuity Engine
Los Angeles,
USA

circle from three points
Say I have three points [0,0] [30,20] [25,5]
How can I find the center and radius of the circle? I'm having a tough time wrapping my head around the math for it. http://www.had2know.com/academics/c...reepoints.html __________________
____________ ___ __ _ John A. Martini JokerMartini@hotmail.com www.JokerMartini.com Last edited by JokerMartini : 06182013 at 04:02 PM. 
06182013, 04:02 PM  #2 
Expert
portfolio
John Martini
CG Supervisor, 3D, Maxscript, VFX
Ingenuity Engine
Los Angeles,
USA

In the end I'm just trying to write a function that I can pass three points and it return me the radius and center of the circle. Kinda like
fn calcCircle A:[0,0] B:[0,0] C:[0,0] = ( return #(radius,center) ) http://paulbourke.net/geometry/circlesphere/ __________________
____________ ___ __ _ John A. Martini JokerMartini@hotmail.com www.JokerMartini.com Last edited by JokerMartini : 06182013 at 04:32 PM. 
06182013, 04:33 PM  #3 
Expert
portfolio
John Martini
CG Supervisor, 3D, Maxscript, VFX
Ingenuity Engine
Los Angeles,
USA

In the end I'm just trying to write a function that I can pass three points and it return me the radius and center of the circle. Kinda like
fn calcCircle A:[0,0] B:[0,0] C:[0,0] = ( return #(radius,center) ) http://paulbourke.net/geometry/circlesphere/ __________________
____________ ___ __ _ John A. Martini JokerMartini@hotmail.com www.JokerMartini.com 
06182013, 06:35 PM  #4  
Architect
portfolio
Branko Živković
Freelancer
Niš,
Serbia
Join Date: Apr 2011
Posts: 1,103

Quote:
I find correct radius of in circle but incenter position is not good. Example: Code:


06182013, 07:15 PM  #5 
isKindOf Artist
portfolio
Vojtech Cada
3D generalist
Czech Republic

Have a look at createCircumcircle function in CAD Circle (needs barycentricToWorld to work, you can ignore the rest).

06182013, 07:37 PM  #6 
Expert
portfolio
John Martini
CG Supervisor, 3D, Maxscript, VFX
Ingenuity Engine
Los Angeles,
USA

Alright ill check that out.
Thank you __________________
____________ ___ __ _ John A. Martini JokerMartini@hotmail.com www.JokerMartini.com 
06192013, 06:05 AM  #7  
MAX Doctor
portfolio
Denis Trofimov
CA,
USA

Quote:
i like: Code:
is it your trick? 

06192013, 01:25 PM  #11 
Expert
portfolio
John Martini
CG Supervisor, 3D, Maxscript, VFX
Ingenuity Engine
Los Angeles,
USA

Thanks Gravey I'll check this thread out as welll
__________________
____________ ___ __ _ John A. Martini JokerMartini@hotmail.com www.JokerMartini.com 
06192013, 07:52 PM  #12 
isKindOf Artist
portfolio
Vojtech Cada
3D generalist
Czech Republic

Gravey: Gosh, I miss the days of college maths... wait, maybe not all that much Anyway, the functions are just a few substitutions away. For a start, let's say we switch the distance function for a lenght of vector.
Code:
This is just to make the transtion easier to follow, as we now use each of these vectors as a variable and the dot product of the vector with itself substitutes the squared distance (getting rid of squaring the square root): Code:
Now, all the negative dot product terms can also be subsituted, Code:
So the three terms are in the end: Code:
No square root anymore, just basic multiplication and stuff  of course here it's no big deal 
06192013, 09:04 PM  #13 
MAX Doctor
portfolio
Denis Trofimov
CA,
USA

what's wrong with this one:
Code:
fastest, cleanest... 
06192013, 09:43 PM  #14  
Architect
portfolio
Branko Živković
Freelancer
Niš,
Serbia
Join Date: Apr 2011
Posts: 1,103

Quote:
Nothing it's just perfect. Anyway thanks Swordslayer for very informative math lesson. 

06192013, 09:43 PM  #15 
Lord of the posts
Join Date: Sep 2003
Posts: 1,066,478

Thread automatically closed
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities Note that as CGTalk Members, you agree to the terms and conditions of using this website. 
Thread Closed share thread 
«
Previous Thread

Next Thread
»

Thread Tools  Search this Thread 
Display Modes  

