geometry - Maple Programming Help

Home : Support : Online Help : Mathematics : Geometry : 2-D Euclidean : Creating Objects : geometry/triangle

geometry

 triangle
 define a triangle

 Calling Sequence triangle(T, [A, B, C], n) triangle(T, [l1, l2, l3], n) triangle(T, [side1, side2, side3]) triangle(T, [side1, 'angle'=theta, side3], n)

Parameters

 T - the name of the triangle A, B, C - three points l1, l2, l3 - three lines side1, side2, side3 - three sides of the triangle side1, 'angle'=theta, side3 - side1 and side3 are the two sides of the triangle, and theta is the angle between them n - (optional) list of two names representing the names of the horizontal-axis and vertical-axis respectively

Description

 • A triangle is a polygon having three sides. A vertex of a triangle is a point at which two of the sides meet.
 • A triangle T can be defined as follows:
 – from three given points A, B, C.
 – from three given lines l1, l2, l3.
 – from the sides of the triangle.
 – from the two sides of the triangle and the angle between them.
 • To access the information relating to a triangle T, use the following function calls:

 form(T) returns the form of the geometric object (i.e., triangle2d if T is a triangle). HorizontalName(T) returns the name of the horizontal-axis; or FAIL if the axis is not assigned a name. VerticalName(T) returns the name of the vertical-axis; or FAIL if the axis is not assigned a name. method(T) the method to define the triangle T. They are points'' if T is defined from three points or three lines. sides'' if T is defined from three sides. angle'' if T is defined from two sides, and the angle between them. DefinedAs(T) returns the list of three vertices of T if T is defined from three points or three lines. the list of three sides of T if T is defined from three sides. the list of two sides and an angle in between if T is defined that way. detail(T) returns a detailed description of the triangle T.

 • The command with(geometry,triangle) allows the use of the abbreviated form of this command.

Examples

 > $\mathrm{with}\left(\mathrm{geometry}\right):$

define three points $A\left(0,0\right),B\left(1,1\right)$, and $C\left(1,0\right)$

 > $\mathrm{point}\left(A,0,0\right),\mathrm{point}\left(B,1,1\right),\mathrm{point}\left(C,1,0\right):$

define the triangle $\mathrm{T1}$ that has $A,B,C$ as its vertices

 > $\mathrm{triangle}\left(\mathrm{T1},\left[A,B,C\right]\right)$
 ${\mathrm{T1}}$ (1)
 > $\mathrm{type}\left(\mathrm{T1},'\mathrm{triangle2d}'\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{method}\left(\mathrm{T1}\right)$
 ${\mathrm{points}}$ (3)
 > $\mathrm{map}\left(\mathrm{coordinates},\mathrm{DefinedAs}\left(\mathrm{T1}\right)\right)$
 $\left[\left[{0}{,}{0}\right]{,}\left[{1}{,}{1}\right]{,}\left[{1}{,}{0}\right]\right]$ (4)

define three lines $\mathrm{l1},\mathrm{l2},\mathrm{l3}$ as follows:

 > $\mathrm{line}\left(\mathrm{l1},y=0,\left[x,y\right]\right),\mathrm{line}\left(\mathrm{l2},y=x,\left[x,y\right]\right),\mathrm{line}\left(\mathrm{l3},x+y-2=0,\left[x,y\right]\right):$

define the triangle $\mathrm{T2}$ from three lines $\mathrm{l1},\mathrm{l2},\mathrm{l3}$:

 > $\mathrm{triangle}\left(\mathrm{T2},\left[\mathrm{l1},\mathrm{l2},\mathrm{l3}\right]\right):$
 > $\mathrm{map}\left(\mathrm{coordinates},\mathrm{DefinedAs}\left(\mathrm{T2}\right)\right)$
 $\left[\left[{0}{,}{0}\right]{,}\left[{2}{,}{0}\right]{,}\left[{1}{,}{1}\right]\right]$ (5)

define the triangle $\mathrm{T3}$ from three sides:

 > $\mathrm{triangle}\left(\mathrm{T3},\left[3,3,3\right]\right):$
 > $\mathrm{detail}\left(\mathrm{T3}\right)$
 $\begin{array}{ll}{\text{name of the object}}& {\mathrm{T3}}\\ {\text{form of the object}}& {\mathrm{triangle2d}}\\ {\text{method to define the triangle}}& {\mathrm{sides}}\\ {\text{the three sides of the triangle}}& \left[{3}{,}{3}{,}{3}\right]\end{array}$ (6)

check if $\mathrm{T3}$ is a equilateral triangle

 > $\mathrm{IsEquilateral}\left(\mathrm{T3}\right)$
 ${\mathrm{true}}$ (7)

define the triangle $\mathrm{T4}$ from two sides and the angle between them:

 > $\mathrm{triangle}\left(\mathrm{T4},\left[2,'\mathrm{angle}'=\frac{\mathrm{π}}{2},1\right]\right):$
 > $\mathrm{method}\left(\mathrm{T4}\right)$
 ${\mathrm{angle}}$ (8)
 > $\mathrm{DefinedAs}\left(\mathrm{T4}\right)$
 $\left[{2}{,}{\mathrm{angle}}{=}\frac{{1}}{{2}}{}{\mathrm{π}}{,}{1}\right]$ (9)
 > $\mathrm{area}\left(\mathrm{T4}\right)$
 ${1}$ (10)