geometry - Maple Programming Help

Home : Support : Online Help : Mathematics : Geometry : 2-D Euclidean : Triangle Geometry : geometry/IsRightTriangle

geometry

 IsRightTriangle
 test if a given triangle is a right triangle

 Calling Sequence IsRightTriangle(ABC, cond )

Parameters

 ABC - triangle cond - (optional) name

Description

 • This routine tests if the given triangle ABC is a right triangle. It returns true if ABC is a right triangle; false if it is not; and FAIL if it is unable to reach a conclusion.
 • If FAIL is returned, and the optional argument is given, the condition that makes ABC a right triangle is assigned to this argument. It will be either of the form $\mathrm{expr}=0$ or of the form $&\mathrm{or}\left(\mathrm{expr_1}=0,\mathrm{expr_2}=0,...,\mathrm{expr_n}\right)$ where expr, expri_i are Maple expressions.
 • The command with(geometry,IsRightTriangle) allows the use of the abbreviated form of this command.

Examples

 > $\mathrm{with}\left(\mathrm{geometry}\right):$
 > $\mathrm{triangle}\left(T,\left[2,2,3\right]\right)$
 ${T}$ (1)
 > $\mathrm{IsRightTriangle}\left(T\right)$
 ${\mathrm{false}}$ (2)
 > $\mathrm{triangle}\left(\mathrm{ABC},\left[\mathrm{point}\left(A,0,0\right),\mathrm{point}\left(B,2,0\right),\mathrm{point}\left(C,0,2\right)\right]\right)$
 ${\mathrm{ABC}}$ (3)
 > $\mathrm{IsRightTriangle}\left(\mathrm{ABC}\right)$
 ${\mathrm{true}}$ (4)
 > $\mathrm{point}\left(B,1,b\right):$
 > $\mathrm{IsRightTriangle}\left(\mathrm{ABC},'\mathrm{cond}'\right)$
 IsRightTriangle:   "hint: one of the following conditions must be satisfied: {-4*b = 0, 4*b-8 = 0, -2*b^2+4*b-2 = 0}"
 ${\mathrm{FAIL}}$ (5)
 > $\mathrm{cond}$
 $\left({-}{4}{}{b}{=}{0}\right){\vee }\left({4}{}{b}{-}{8}{=}{0}\right){\vee }\left({-}{2}{}{{b}}^{{2}}{+}{4}{}{b}{-}{2}{=}{0}\right)$ (6)
 > $\mathrm{assume}\left(\mathrm{op}\left(1,\mathrm{cond}\right)\right)$
 > $\mathrm{IsRightTriangle}\left(\mathrm{ABC}\right)$
 ${\mathrm{true}}$ (7)