Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
One interesting problem in geometry

Subject: One interesting problem in geometry

From: samik

Date: 2 May, 2011 23:09:05

Message: 1 of 7

Given the coordinates of the 3 vertices of any triangle. How can we inscribe an equilateral triangle inside that given triangle. That means the vertices of the equilateral triangle will lie on the sides of the given triangle.Any one has any closed form solution to plot this equilateral triangle?

Subject: One interesting problem in geometry

From: Florin Neacsu

Date: 2 May, 2011 23:56:07

Message: 2 of 7

"samik " <das.samik@gmail.com> wrote in message <ipndih$g5n$1@fred.mathworks.com>...
> Given the coordinates of the 3 vertices of any triangle. How can we inscribe an equilateral triangle inside that given triangle. That means the vertices of the equilateral triangle will lie on the sides of the given triangle.Any one has any closed form solution to plot this equilateral triangle?

Hi,

The intersection of the three bisectors(I guess this is the word for the line separating an angle into two equal angles) have a common intersection point which is the center of a circle. If you consider the radius of that circle as S/p with S the surface of the triangle and p the semi-perimeter, the you obtain an circle "interior" to the triangle. Whitin this circle you can construct an equilateral triangle.

If you need functions to plot all this, I think you can find on fileexchange "geom2d".

Regards,
Florin

Subject: One interesting problem in geometry

From: Roger Stafford

Date: 3 May, 2011 00:04:04

Message: 3 of 7

"samik " <das.samik@gmail.com> wrote in message <ipndih$g5n$1@fred.mathworks.com>...
> Given the coordinates of the 3 vertices of any triangle. How can we inscribe an equilateral triangle inside that given triangle. That means the vertices of the equilateral triangle will lie on the sides of the given triangle.Any one has any closed form solution to plot this equilateral triangle?
- - - - - - -
  The trouble with that problem is that in general there will be infinitely many possible solutions. To see this, suppose the given triangle is itself equilateral. Then any inner triangle made up of points on the three sides which have a common ratio of distances along the edges to the three outer vertices will necessarily also be equilateral. That is, if each point on a side cuts its edge in, say, a 2-to-3 ratio in a counterclockwise sense, then the three points points must all be the same distance apart.

  Or to view things differently, there are three independent parameters that would determine a triangle inscribed within another given triangle - that is three degrees of freedom. Requiring the inner triangle to be equilateral imposes only two conditions or equations on these three parameters. One more is needed for a unique solution.

Roger Stafford

Subject: One interesting problem in geometry

From: samik

Date: 3 May, 2011 00:10:22

Message: 4 of 7

"Florin Neacsu" wrote in message <ipngan$qp2$1@fred.mathworks.com>...
> "samik " <das.samik@gmail.com> wrote in message <ipndih$g5n$1@fred.mathworks.com>...
> > Given the coordinates of the 3 vertices of any triangle. How can we inscribe an equilateral triangle inside that given triangle. That means the vertices of the equilateral triangle will lie on the sides of the given triangle.Any one has any closed form solution to plot this equilateral triangle?
>
> Hi,
>
> The intersection of the three bisectors(I guess this is the word for the line separating an angle into two equal angles) have a common intersection point which is the center of a circle. If you consider the radius of that circle as S/p with S the surface of the triangle and p the semi-perimeter, the you obtain an circle "interior" to the triangle. Whitin this circle you can construct an equilateral triangle.
>
> If you need functions to plot all this, I think you can find on fileexchange "geom2d".
>
> Regards,
> Florin

Hi Florin,

But that triangle will not necessarily have its vertices falling on the sides of the given triangle. It will be inscribed in the circles though. Hence this will not be the solution of the problem that I mentioned.

Samik

Subject: One interesting problem in geometry

From: Florin Neacsu

Date: 3 May, 2011 00:35:05

Message: 5 of 7

"samik " <das.samik@gmail.com> wrote in message <ipnh5e$9vl$1@fred.mathworks.com>...
> "Florin Neacsu" wrote in message <ipngan$qp2$1@fred.mathworks.com>...
> > "samik " <das.samik@gmail.com> wrote in message <ipndih$g5n$1@fred.mathworks.com>...
> > > Given the coordinates of the 3 vertices of any triangle. How can we inscribe an equilateral triangle inside that given triangle. That means the vertices of the equilateral triangle will lie on the sides of the given triangle.Any one has any closed form solution to plot this equilateral triangle?
> >
> > Hi,
> >
> > The intersection of the three bisectors(I guess this is the word for the line separating an angle into two equal angles) have a common intersection point which is the center of a circle. If you consider the radius of that circle as S/p with S the surface of the triangle and p the semi-perimeter, the you obtain an circle "interior" to the triangle. Whitin this circle you can construct an equilateral triangle.
> >
> > If you need functions to plot all this, I think you can find on fileexchange "geom2d".
> >
> > Regards,
> > Florin
>
> Hi Florin,
>
> But that triangle will not necessarily have its vertices falling on the sides of the given triangle. It will be inscribed in the circles though. Hence this will not be the solution of the problem that I mentioned.
>
> Samik

Hello,
Indeed, it will not. I overlooked that detailed. Sorry about that.
Florin

Subject: One interesting problem in geometry

From: Roger Stafford

Date: 5 May, 2011 23:16:05

Message: 6 of 7

"samik " <das.samik@gmail.com> wrote in message <ipndih$g5n$1@fred.mathworks.com>...
> Given the coordinates of the 3 vertices of any triangle. How can we inscribe an equilateral triangle inside that given triangle. That means the vertices of the equilateral triangle will lie on the sides of the given triangle.Any one has any closed form solution to plot this equilateral triangle?
- - - - - - - - - -
  I have thought about your interesting geometry problem a little more, Samik. It seems to me that an appropriate canonical condition to place on the inscribed triangle is that it have a minimum perimeter, or what is equivalent in this case, a minimum possible area. With that requirement the inscribed triangle becomes unique and behaves as one might expect. In the case of an outer triangle which is also equilateral, the minimum inner equilateral triangle would have vertices located at the midpoints of the sides of the outer triangle.

  On paper I have managed to show that the solution can be found by maximizing (yes maximizing) a certain trigonometric expression which gives rise to a quite solvable equation of its derivative. I am sure that it could be made into a decent matlab procedure but it is sufficiently complicated that I haven't found the time to do it, (at least not yet.)

  After doing the above paper scribbling, I found the following websites which also purport to have a solution to this minimization problem, though I haven't had time to understand their presentation on that yet. They do acknowledge that it is a difficult problem. You might check them out if you are still interested:

 http://mathafou.free.fr/pbg_en/sol143.html
 http://mathafou.free.fr/pbg_en/sol143b.html

Roger Stafford

Subject: One interesting problem in geometry

From: Roger Stafford

Date: 7 May, 2011 06:37:04

Message: 7 of 7

"Roger Stafford" wrote in message <ipvb3l$2k9$1@newscl01ah.mathworks.com>...
> I have thought about your interesting geometry problem a little more, Samik. ....
- - - - - - -
  I finally found time to translate my paper solution to the matlab function below which I have called 'mintri'. As I said earlier, its solution is unique by requiring that the inscribed triangle have a minimum area.

  I have subjected it to a number of tests and presumably all the bugs have been eliminated. If you encounter any difficulties, please let me know.

  I have not decided whether to enter it into the FEX. I doubt that very many people would be interested in such a special purpose function, but you never know.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function T2 = mintri(T1)

% T2 = mintri(T1)
% Argument T1 is a 3 by 2 array in which its three rows
% are each x,y coordinates defining the three vertices of
% an outer triangle. The returned 3 by 2 array, T2, is a
% similar representation of the three vertices of an
% equilateral triangle inscribed in the sides of the outer
% triangle and having the property that its area is the
% minimum among all such inscribed equilateral triangles.
% Roger Stafford - May 6, 2011

PA = T1(1,:); PB = T1(2,:); PC = T1(3,:);
A = atan2(abs(det([PB-PA;PC-PA])),dot(PB-PA,PC-PA));
B = atan2(abs(det([PC-PB;PA-PB])),dot(PC-PB,PA-PB));
C = atan2(abs(det([PA-PC;PB-PC])),dot(PA-PC,PB-PC));
t1 = max(-2/3*pi+2/3*[A-B,B-C,C-A]);
t2 = min( 2/3*pi+2/3*[C-A,A-B,B-C]);
k1 = cos((C-B)/3)/sin(A)+cos((A-C)/3)/sin(B)+cos((B-A)/3)/sin(C);
k2 = sin((C-B)/3)/sin(A)+sin((A-C)/3)/sin(B)+sin((B-A)/3)/sin(C);
t0 = atan2(k2,k1);
if t1<=t0 & t0<=t2, t = [t1,t0,t2]; else t = [t1,t2]; end
[ig,ix] = max(k1*cos(t)+k2*sin(t)); t = t(ix);
s1 = sin(-t/2 + pi/3 + (C-A)/3)/sin(A);
s1 = s1/(s1+sin(t/2 + pi/3 + (C-B)/3)/sin(B));
s2 = sin(-t/2 + pi/3 + (A-B)/3)/sin(B);
s2 = s2/(s2+sin(t/2 + pi/3 + (A-C)/3)/sin(C));
s3 = sin(-t/2 + pi/3 + (B-C)/3)/sin(C);
s3 = s3/(s3+sin(t/2 + pi/3 + (B-A)/3)/sin(A));
T2 = [s1*PB+(1-s1)*PA;s2*PC+(1-s2)*PB;s3*PA+(1-s3)*PC];
return
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Roger Stafford

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us