# Category Archives: geometry

## Pi

We published a new video lecture. Celebrating Pi day.

3/14/2010

Filed under geometry, math, Mathematica, mathematics

## One easy problem and One not so easy problem.

A few post ago we used Mathematica to draw the altitudes of an arbitrary triangle of given coordinates. Now we are solving these other two problems The first figure the red lines represent the medians and on the second figure the yellow lines represent the angle bisectors. So our problem consist in finding the Mathematica code to produce these figures.

Let us do the easy one first. To draw a triangle and the medians we will use the Lineal Bezier equation we have use before and since we are interested in finding the mid points on each side the resulting Mathematica code is very simple.

**a = {0, 0};
b = {3, 0};
c = {1, 2};
BAB[t_, a_, b_] := (1 – t) a + t b;
Graphics[{Background -> Black,
{{Thick, Blue, Line[{a, b, c, a}]},
{Thick, Red, Line[{c, BAB[1/2, a, b]}]},
{Thick, Red, Line[{a, BAB[1/2, c, b]}]},
{Thick, Red, Line[{b, BAB[1/2, c, a]}]}
},
Inset[Text[Style[“A”, White, Italic, Large]], {-.1, 0}],
Inset[Text[Style[“B”, White, Italic, Large]], {3.1, 0}],
Inset[Text[Style[“C”, White, Italic, Large]], {1.1, 2.1}]}]**

Now for the angle bisectors it is a bit harder. We are going to need some property the bisectors satisfy that will allow us to get the coordinates of the intersection of each bisector with each of the sides. One property that could help us is this one.

**Theorem:** For a triangle *ABC* If *CQ* is the bisector thru the angle *ACB *then *AC/CB*=*AQ/QB*.

Notice we will need to find some distances between sides that are given by coordinates so the function EuclideanDistance will be of help. Since we can easily compute AC/CB we need to find Q in AB such that AQ/QB is equal to AC/CB but this is not difficult to achieve if we use the function Nearest. We can guess the best value of Q by building a table where Q is going from A to B and then we pick the best value that approaches to the ratio AC/CB. We can accomplished that with the following Mathematica Code.

**a = {0, 0};
b = {3, 0};
c = {1, 2};
ac = EuclideanDistance[a, c];
bc = EuclideanDistance[b, c];
ab = EuclideanDistance[a, b];
cc = ac/bc;
BAB[t_, a_, b_] := (1 – t) a + t b;
N[cc];
tabl = Table[
EuclideanDistance[a, BAB[t, a, b]]/
EuclideanDistance[b, BAB[t, a, b]], {t, 0.000001, 1, 0.001}];
nearest = Nearest[tabl, N[cc]];
Flatten[Position[tabl, First[nearest]]] **

that will give us the value 443 that we will use in conjunction with the 0.001 doing similarly for the other sides of the triangle we get the very compact solution

**a = {0, 0};
b = {3, 0};
c = {1, 2};
BAB[t_, a_, b_] := (1 – t) a + t b;
Graphics[{Background -> Black,
{{Thick, Blue, Line[{a, b, c, a}]},
{Thick, Yellow, Line[{c, BAB[443*0.001, a, b]}]},
{Thick, Yellow, Line[{a, BAB[428*0.001, c, b]}]},
{Thick, Yellow, Line[{b, BAB[486*0.001, c, a]}]}
},
Inset[Text[Style[“A”, White, Italic, Large]], {-.1, 0}],
Inset[Text[Style[“B”, White, Italic, Large]], {3.1, 0}],
Inset[Text[Style[“C”, White, Italic, Large]], {1.1, 2.1}]}]**

Again this time Nearest comes to the rescue and helps us get the best value from a list of possible values!

Filed under geometry, math, mathematics

## San Gaku (Sangaku)

**Japanese Temple Geometry**

During the Edo period Japan was isolated from other countries. In this period of isolation Japanese mathematical results flourished mainly in the form of geometric theorems written in tablets offered in temples.

The majority of the problems appearing on tablets are geometric problems and most of them are problems where certain geometric configuration of circles and triangles are given and it is asked to find a quantity like the radius of a circle or the side of the triangle or the diagonal of a quadrilateral.

Many of these Japanese problems are available in English in a Canadian book now out of print.

The book is

Japanese Temple Geometry (San Gaku) by Hidetosi Fukagawa and Dan Pedoe

There is also a publication available for free in PDF form of many problems that can be obtained from

Japanese Temple Mathematical problems in Nagano Pref. Japan

This publication is divided into 5 PDF files and contain many problems

Some more links to Sangaku

Filed under geometry, math, mathematics

## Inexpensive Modern Geometry Books by Dover

One of the things I hate and I am talking hate here, is when wonderful books go out of print and they become hard to get. I spend a considerable amount of time looking for two geometry books that I have seen and wanted to owned for a very long time. This two books are amazingly beautiful Geometry books. The books are

and

Advanced Euclidean Geometry by Roger A. Johnson

I was able to find College Geometry by Nathan by chance, while I was browsing thru stacks of old neglected books in a used book store close to my home and I got it for just about 10 dollars (hard cover edition from 1925) in very good condition!

I have seen on used book sites people selling this amazing books for about 100 dollars or more but I was not willing to depart with my price book! Not for 100 or even more.

As for the second book I place a search want at a used books internet seller and was able to get it after some years from some book seller in California for about 6 dollars. Never mind that I have seen people asking more than ten times that value somewhere in the internet.

But wait no more. Dover books has published both books again. In paper back at a very reasonable price! each about 16 dollars but amazon will sell them both for about 28 dollars.

If you do like theorems like the nine point circle, Ptolemy’s theorem, Simson line, Menelaus Theorem, Ceva’s theorem then these are the books to get.

This is a blog posting from www.isallaboutmath.com

Comments Off on Inexpensive Modern Geometry Books by Dover

Filed under geometry, math, mathematics

## Producing animations with Mathematica 6.0 is as easy as pie

Mathematica 6.0 by Wolfram is a mile stone!

The system allow one to produce with ease animations of mathematical objects like

I was set into animating a cycloid. This is the curve describe by a point on a circle rotating over a line without slipping.

This is actually a very interesting curve that was studied by Galileo, Roberval, Fermat, Descartes, Huygen and Johann Bernoulli in fact he discover this curve is a brachistochrone even more he propose the problem of finding the curve of fastest descent and inaugurating with this problem the variational calculus.

The animation above creates a curve named prolate cycloid one is able to find the meaning of the word prolate in

Websters Dictionary

1. |
Stretched out; extended; especially, elongated in the direction of a line joining the poles; as, a prolate spheroid; – opposed to oblate. |

and also the definition for

**1.***(Astron.)* Shortened or reduced; – said of the distance of a planet from the sun or earth, as measured in the plane of the ecliptic, or the distance from the sun or earth to that point where a perpendicular, let fall from the planet upon the plane of the ecliptic, meets the ecliptic.

and we also have then the curtate cycloid.

you may also consult Mathworld at

if you like to reproduce the above animations using Mathematica 6.0

you could use the following code

Manipulate[

Graphics[

{

{Thick, Yellow, Disk[{x, 1}, 1]},

{Thick, Orange, Circle[{x, 1}, 1]},

{Blue, Thickness[.008],

Line[{{x, 1}, {x – q Sin[x], 1 – q Cos[x]}}]},

{PointSize[Large], Red, Point[{x, 1}]},

{PointSize[Large], Magenta, Point[{x – q Sin[x], 1 – q Cos[x]}]},

If[trace,

{Red, Thick,

Line[

Table[{t – q Sin[t], 1 – q Cos[t]}, {t, 0, x, 0.001}]

]}]

}, AspectRatio -> Automatic, Background -> Black,

ImageSize -> {640, 480}, ImagePadding -> 100, AxesOrigin -> {0, 0},

If[va, Axes -> True, Axes -> {True, False}],

AxesStyle -> Directive[Thick, Orange, If[p < 2 Pi, 24, 12]],

PlotRange -> {{-1, 2 p + .5}, {-.5, 2.3}},

If[ticks, Ticks -> {Range[IntegerPart[2 p + .5]], {1, 2}},

Ticks -> {{None}, {None}}]

], {{x, 0}, 0, 2 p, 0.001}, {{q, 1}, 0.01, 5, 0.001}, {{p, Pi},

0.01, 4 Pi,

0.001}, {trace, {True, False}}, {ticks, {True, False}}, {va, {True,

False}}

]

If you like the above posting you may also enjoy this

Building a Geometric figure with Mathematica

This is a blog posting from www.isallaboutmath.com

Filed under geometry, math, Mathematica, programming

## Building a Geometric figure with Mathematica.

Not too long ago I wrote here a small piece on creating beautiful figures, I was trying to explain a non trivial example on how to use METAPOST a system created by John D Hobby to build a geometric figure.

I was reading a blog post by Chris Carlson of Wolfram Research named “Always the Right Time for Mathematica” and decided to give Mathematica a try with the same problem in my prior blog post.

So here is the problem again in case you are too lazy to read my prior posting!

Build the following figure. (The lines in red are the altitudes of the triangle)

Well, here is the issue. Mathematica is a general purpose computer system but is not specifically design for graphics like METAFONT, still it should be very straight forward to build some figure like above.Fortunately Mathematica is very rich on Mathematics and this should make the solution easy. We can see multiple path of solution to the problem at hand.

Mathematica provide some native commands that allow one to draw lines and point in such and such Cartesian coordinates. So to draw the triangle ABC with Mathematica we can use the following command.

Graphics[{Thick,Blue,

Line[{{0,0},{3,0},{1,2},{0,0}}],

Black,Inset[Text[Style[“A”,Italic,Large]],{-.1,0}],

Black,Inset[Text[Style[“B”,Italic,Large]],{3.1,0}],

Black,Inset[Text[Style[“C”,Italic,Large]],{1.1,2.1}]

}]

]

Where the Line[] Mathematica function draws the triangle and the Inset places the vertex labels in the figure.

The hard part is figuring out how to find the coordinates for the altitudes feet. If we can find a way to get those coordinates then our problem is solve.

Since we are trying to build the altitudes to the triangle. We need to search for properties the altitudes of a triangle satisfy that will facilitate this construction.

**Geometrically** *we can characterize the altitudes of a triangle as the line segment from a vertex to the opposite side and this segment is perpendicular to that side*.

**Other property is:** *the altitude from a vertex is the minimal length segment we can build from the vertex to the opposite side.*

**And yet another property:** *One can build by reflection symmetry with respect to the side the vertex when reflected this way will produce another symmetrically opposite vertex and joining those two by a segment , half that segment will be the altitude.*

You may find the proof to the above facts in some geometry book. If not you should try to proof them yourself.

We will discuss first the minimal path approach.

It seems that if we can build some function depending on one variable that give us any of the points between B and C then we shall be able to find the distance between any of those points and the point A. We should be able to repeat the same procedure for the other vertex.

Well it is good to know the linear Bezier curve equation.

B(t)=C+(B-C)t with t from [0,1]

Since B(t) gives us any point between B and C this shall come very handy in our computations.

Now all we need is to find the distance from B(x) to A and then that should give us a function depending on x. Finding the zeros of first derivative to this function we shall be able to find the values of x such that the distance from B(x) to A is minimal.

This can be performed using the following Mathematica code.

m[v_?MatrixQ]:=Module[{x,a=v[[1]],b=v[[2]],c=v[[3]]},

sol=Solve[D[Simplify[EuclideanDistance[c,BAB[x,a,b]],x>0],x]0,x];

{Red,Thick,Line[{c,BAB[First[x/.sol],a,b]}]}

]

So all that remains for us is to draw the graph

BAB[t_,a_,b_]=(1-t) a+t b;

m[v_?MatrixQ]:=Module[{x,a=v[[1]],b=v[[2]],c=v[[3]]},

sol=Solve[D[Simplify[EuclideanDistance[c,BAB[x,a,b]],x>0],x]0,x];

{Red,Thick,Line[{c,BAB[First[x/.sol],a,b]}]}

]

l[v_?MatrixQ]:=Module[{a=v[[1,1]],col=v[[1,2]],b=v[[2]]},

{col,Inset[Text[Style[a,Italic,Large]],b]}

]

Module[{a={0,0},b={3,0},c={1,2}},

Graphics[{Thick,Blue,

Line[{a,b,c,a}],

Map[m,{{a,b,c},{a,c,b},{b,c,a}}],

Map[l,{{{“A”,Red},{-.1,0}},{{“B”,Blue},{3.1,0}},{{“C”,Black},{1.1,2.1}}}]

}]

]

This solution is valid for A,B and C that form a non obtuse triangle. Can you see why?

I was still not completely satisfied with this solution. Because I wanted something that did not had to use calculus knowledge. So it is fortunate that Mathematica provide other functions like Nearest[], that allow to find from a list of points the closest point to a given point.

I can produce the list of points easily using the table

Something like

Table[BAB[x,{3,0},{1,2}],{x,0,1,0.01}]

And this

Nearest[Table[BAB[x,{3,0},{1,2}],{x,0,1,0.01}],{0,0}]

Should get me a point sufficiently close to the base of the altitude. We repeat the same procedure for the others so the resulting code looks like this.

BAB[t_,a_,b_]=(1-t) a+t b;

Module[{AA=Flatten[Nearest[Table[BAB[x,{3,0},{1,2}],{x,0,1,0.01}],{0,0}]],

BB=Flatten[Nearest[Table[BAB[x,{0,0},{3,0}],{x,0,1,0.01}],{1,2}]],

CC=Flatten[Nearest[Table[BAB[x,{0,0},{1,2}],{x,0,1,0.01}],{3,0}]]

},

Graphics[{Thick,Blue,

Line[{{0,0},{3,0},{1,2},{0,0}}],

Red,Line[{{0,0},AA}],

PointSize[Large],Orange,Point[AA],

Red,Line[{{1,2},BB}],

PointSize[Large],Orange,Point[BB],

Red,Line[{{3,0},CC}],

PointSize[Large],Orange,Point[CC]

}

]

]

Yet one last solution this time using the symmetry of the vertex with respect to each of the side and finding the middle point.

BAB[t_,a_,b_]=(1-t) a+t b;

Module[{rab=ReflectionTransform[Cross[{3,0}-{0,0}],{0,0}],

rac=ReflectionTransform[Cross[{1,2}-{0,0}],{0,0}],

rcb=ReflectionTransform[Cross[{1,2}-{3,0}],{3,0}]

},

Graphics[{Thick,Blue,

Line[{{0,0},{3,0},{1,2},{0,0}}],

Red,Line[{{1,2},BAB[1/2,{1,2},rab[{1,2}]]}],

Red,Line[{{3,0},BAB[1/2,{3,0},rac[{3,0}]]}],

Red,Line[{{0,0},BAB[1/2,{0,0},rcb[{0,0}]]}]

}]

]

In this case we are using Cross[] to get the perpendicular vector to a given vector and ReflectionTransform[] will give us the corresponding transformation Matrix that performs the reflection symmetry that we need. This solution should be valid for any triangle define by the points A,B and C.

We can see from the 3 solutions above, that Mathematica is a very powerful system when it comes to mathematical computation and it is not difficult once one have the mathematical knowledge to use a system like Mathematica to come up with a solution to a given problem.

If you do have Mathematica and like to try your hands at this problem then try solving it this other way by finding the intersection of a line perpendicular to the given side that passes by the vertex opposite to the side. This should be fairly straight forward!

This is a blog posting from www.isallaboutmath.com

Filed under geometry, graphics, math, Mathematica, mathematics