# Tagged Questions

Questions on the application of Mathematica to geometric problems. You might also consider adding the [graphics] tag, if appropriate.

2k views

### Fitting ellipse to 5 given points on the plane

Five points are required to define a unique ellipse. An ellipse has five degrees of freedom: the $x$ and $y$ coordinates of each focus, and the sum of the distance from each focus to a point on the ...
920 views

### Finding the surface area of a 3D convex hull

I have noted several instances here and here where ConvexHullMesh, introduced in v10 has been used to greatly simplify some geometry problems. Determining the ...
542 views

### How to manipulate a circle in GeoGebra style?

I want to emulate the GeoGebra app. I want to get an effect like this in Mathematica. I don't know how to move whole circle without changing the radius of the circle. My sample code： ...
2k views

### Finding length of intersection of two surfaces

I would like to know how we find the length of the intersection of two surfaces. For instance, in the following example,a surface intersects with a plane: How do we find the length of intersection ...
196 views

### Plotting a Partially Filled Ellipse

I would like to plot a partially filled/shaded ellipse. The code below shades the whole ellipse. However, I only want to shade the part of the ellipse to the right of the vertical line where x > ...
1k views

### To inscribe a circle in a given triangle

I am trying to to inscribe a circle in a given triangle but it isn't working. I've used GeoGebra with this construction and worked but as I'm new to Mathematica I am missing something. It can't be so ...
786 views

### Proving the hairy ball theorem using xAct

I would like to formally prove the hairy ball theorem in Mathematica, initially just for $S^2$, and then see about generalizing. An approach I thought about to use the xAct package to define $S^2$ ...
3k views

### 2D random walk within a bounded area

I want to simulate a random walk on two dimension in a bounded area such as a square or circle. I am thinking of using If statement to define a boundary. Is there a ...
254 views

### Is it necessary to introduce ImplicitRegion and ParametricRegion in version 10?

In version 10.0, Mathematica introduced a new function about region plotting: ImplicitRegion. But I'm wondered that haven't this function been already existed in the older version? That is, ...
315 views

### Matrix containing ellipse

I have to make a matrix which contains elements in an ellipse shaped region, but I need to make ellipse region in such a way that larger axis of ellipse is inclined with angle θ with horizontal. With <...
623 views

### How to generate nonperiodic tilings?

I need to generate nonperiodic tilings which are similar to the attached figure (kite-domino tiling). I was thinking the code is similar to the code for the Penrose tiling. However, that code is too ...
277 views

### Generating cylindrical geometry via extruding a section

Toady I want to build geometry as shown below: I know the Mathematica owns the built-in like Cylinder[], Sphere[] and so on, ...
259 views

### VoronoiMesh for 3D points

I believe that this is a doc error in V10 (this was programmed to be but not implemented). The new VoronoiMesh should work for 3D set of points. The ...
354 views

### Death of parallel sub-kernels

EDIT : Finally, the new Mathematica 10.0 seems to fix it. I have a little parallelization problem. I wrote a code to generate a quasicrystal by dynamical generation. Here the code: ...
1k views

### How to find all data points within closed curve

I want to find all data points inside curve as given below: ...
1k views

### An easier way to find the properties of an ellipse from its equation?

In this Q&A about fitting an ellipse to a set of points, there are multiple answers that generated general equations of the ellipse, like this one by @ubpdqn: However, the steps to find out the ...
104 views

### Symbolic Output after numerical computation

I have a small question about the symbolic output. I started to write a program that generates the coordinates of n-dimensional polytopes by Wythoff construction. For crystallographic groups, all is ...
2k views

### Find intersection of pairs of straight lines

I have a list of 24 points, in which two consecutive points (1st and 2nd, 3rd and 4th, …) are supposed to form a line: ...
146 views

### how to find iso-cost contours on a 2d plot efficiently

Consider a 2D plot in which dimension 1 and 2 represent quantity 1 and 2 respectively ranging over 0 to 100. Each point in the space corresponding to (x,y) represent cost of choosing quantity 1 as x ...
396 views

### How to map vertex points from the surface of a straight pipe onto 2D plane

How to map vertex points from the surface of a straight pipe onto 2D plane. The 3D surface points of the straight pipe can be found here: data Working code: ...
413 views

### Generate a set of 3D coordinates subject to constraints

Generating a set of random 3D coordinates is ok, e.g. ...
1k views

### Rebuild a polygon so it doesn't self intersect [duplicate]

If you consider the following Polygon: ...
161 views

### Height average between 4 points

I have a $3D$ space, if I had a square in this space: square = {{ 0, 0, 100}, { 100, 100, 50}, { 0, 100, 22}, { 100, 0, 86}}; how could I get the average height ...
872 views

### Distribution of 10 points within a unit square

Related to some packing problems, following problem arose: Distribute 10 points within a square of sides 1, so that minimal distance between them is maximized. With the help of random simulation, or ...
978 views

### Distance between two line segments in 3-space

I need to compute the distance between two line segments in a project. After googling, I found this algorithm and used it to implement a Mathematica version: ...
866 views

### Creating sculptural forms using graphics primitives

This is a question based on this answer by halirutan. Some amazing images can be created with this code, and I was wondering whether it was possible to extend the principle to different shapes. I ...
442 views

### How to use Undocumented Functions Prism, Tetrahedron and Hexahedron

Taking a look at this question and this one, I checked to see if Mathematica really does not have a Prism primitive. To my surprise the function ...
1k views

### Intersection of surface with parallel planes

Consider the code (adapted from here) ...
511 views

### Area of a convex polygon with a set of points [duplicate]

I have a set of points Pts[a_,b_,c_]:={{a, b}, {b, a}, {c, a}, {a, c}, {b, c}, {c, b}} which define a convex polygon and I would like to find its area. There is ...
1k views

### Choosing $n$ equidistant points on a circle with given radius and center

I would like to have a function circle which takes two inputs: a tuple {x,y} and a real number ...
162 views

### How to get the dimensions of a rectangle?

Suppose I create a Rectangle of dimensions 1 and 3. Is there any function in Mathematica that I can use to recover the dimensions of the original rectangle? If there is no such a function, is there a ...
806 views

### Draw generalized k-ellipse using “the locus of points so that sum of the distances to the foci is constant” deffinition

My goal is to draw a family (for different distances) of 3-ellipse for equilateral set of foci. 3-ellipse definition is: "the locus of points so that sum of the distances to the three foci is ...
296 views

3k views

### How to plot ternary density plots?

How can I get a ternary density plot just like the plots from OriginLab? ContourPlot and DensityPlot seemingly can accept the <...
381 views

### Return “true” if point is in Convex Hull [duplicate]

I have a set of points Z: Z = {{x1,y1},{x2,y2},..,} I would like to obtain a function that returns ...
713 views

### How to simulate the true reflective movement of a particle bouncing around in an ellipse?

Please help me to simulate the movement of a particle inside a region with elliptical walls such that particle is reflected from the walls and continues to move. A friend was able write code to ...
495 views

### Plot a cone in spherical co-ordinates

As we all know in spherical coordinates a function phi = π/3 gives us a cone. The cone makes an angle of π/3 with the imagined <...
635 views

### Code to give center of circle given three points in 2D? [duplicate]

does anyone know how to make a function C(p1,p2,p3)=center of circle that goes through p1, p2, and p3? This is in 2D Sorry this is poorly written but I ...
809 views

### Imposing a Periodic Boundary Condition in Nearest Neighbour Search

I am trying to find first nearest neighbour distributions of randomly dispersed point-like objects in an infinite system. To do this I make a finite sized box unit cell with a chosen concentration of ...
1k views

### Uniformly distributed n-dimensional probability vectors over a simplex

What's the right way to generate a random probability vector $p={p_1,\ldots,p_n} \in {(0,1)}^n$ where $\sum_i p_i=1$, uniformly distributed over the $(n-1)$-dimensional simplex? What I have is ...
760 views

### Ellipse counting from image

I have hundreds of images similar to this image: I'm looking to count the number of ellipses as well as their major and minor diameters. The ellipses are touching, hence, ...
801 views

...
516 views

### How to make a filled Ellipsoid?

I want to make a filled Ellipsoid, but it seems Filling options doesn't work in Graphics ...
I want to find the numbers $a$, $b$, $c$, $d$ of the function $y = \dfrac{a x + b}{c x + d}$ so that the triangle $ABC$ with three points $A$, $B$, $C$ have integer coordinates and lies on the graph ...