7
$\begingroup$

I came across the problem of calculating the circumcenters of triangles symbolically within another algorithm (as well as possibly doing other similar geometry computations). I was hoping Mathematica would have built-in support for geometry computations like this, but the closest thing I could find was RegionCentroid (which of course calculates the centroid, not the circumcenter).

However, on the Wolfram MathWorld page for Circumcenter I saw there is an option to download a Mathematica notebook (just below the page title "Circumcenter"). This notebook requires the MathWorld`PlaneGeometry` package, which contains functionality to calculate circumcenters as well as tons of other useful stuff, but it apparently was removed from Mathematica (for I do not know what reason) somewhere along the line. Using the answer to this post (Where to download the MathWorld package?) and the Wayback Machine I was able to find the package, but it appears to be incompatible with Mathematica 10 anyways.

Beyond the MathWorld packages then, are there other packages that would have functionality to do things like compute circumcenters (or even better, is there built-in functionality for this that I have not found)?

I could write my own algorithm to compute a circumcenter, but this seems like a common enough geometrical computation that it and other computations like it are probably readily implemented somewhere.

$\endgroup$
3
  • $\begingroup$ The package is incompatible with any recent version of Mathematica. Current support for geometric computations is radically different and much extended over the old version of Mathematica for which the package MathWorld`PlaneGeometry was written. $\endgroup$
    – m_goldberg
    Jul 13, 2017 at 0:00
  • $\begingroup$ @m_goldberg What do you mean by "radically different and much extended"? I am still not sure why they would remove support for what seems like a set of highly useful geometric functionality (unless you are saying that such support was not in fact removed but extended...?). $\endgroup$
    – Grayscale
    Jul 13, 2017 at 12:47
  • 1
    $\begingroup$ If you don't have a version of Mathematica with the built-in Circumsphere[] function, see this. $\endgroup$ Jul 26, 2017 at 5:30

1 Answer 1

10
$\begingroup$

The following is a built-in way of finding circumcenters:

gr = Graphics[{
   Circumsphere[{{0, 0}, {1, 0}, {0, 1}}],
   Triangle[{{0, 0}, {1, 0}, {0, 1}}]
   }];

Mathematica graphics

center = First@Circumsphere[{{0, 0}, {1, 0}, {0, 1}}]

{1/2, 1/2}

gr = Graphics[{
   Circumsphere[{{0, 0}, {1, 0}, {0, 1}}],
   Triangle[{{0, 0}, {1, 0}, {0, 1}}],
   Red, PointSize[Large], Point[center]
   }]

Mathematica graphics

First@Circumsphere[{{0, 0}, {1, 0}, {0, 1}}] is used because Circumsphere returns a Sphere graphics primitive. The first argument of the Sphere graphics primitive is the center.

$\endgroup$
5
  • 1
    $\begingroup$ Do you need to use Cases to extract the info? Circumsphere evaluates directly to a Sphere outside of Graphics, so you could just do In[22]:= First@Circumsphere[{{0, 0}, {1, 0}, {0, 1}}] Out[22]= {1/2, 1/2} $\endgroup$
    – Jason B.
    Jul 12, 2017 at 18:44
  • $\begingroup$ @JasonB. This is a fair point, I didn't think about that. I will update the answer. $\endgroup$
    – C. E.
    Jul 12, 2017 at 18:46
  • $\begingroup$ Thanks! I did not think to use graphics primitives (the approach of constructing graphics and then recovering geometry information does seem weird). However, though this is a nice solution for calculating the circumcenter, I am guessing if you wanted to calculate something more complicated like the Nagel point or the Spieker center this graphics-based approach would not work... I am still wondering if there is functionality for more general geometric computations somewhere. $\endgroup$
    – Grayscale
    Jul 12, 2017 at 19:21
  • $\begingroup$ I mean there is a lot more stuff pertaining to both simple geometry and computational geometry. The new stuff is mostly based on simplexes and regions built-up from meshes of simplexes. If you want to know more, go to the Wolfram Language site and an click on Geometry. $\endgroup$
    – m_goldberg
    Jul 13, 2017 at 22:21
  • $\begingroup$ @Grayscale The comment above was meant for you, as a response to what you were talking about in the comments to the question. $\endgroup$
    – C. E.
    Jul 13, 2017 at 22:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.