 geometry - Maple Programming Help

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

geometry

 segment
 define a segment
 dsegment
 define a directed segment

 Calling Sequence segment(seg, [P1, P2]) segment(seg, P1, P2) dsegment(seg, [P1, P2]) dsegment(seg, P1, P2)

Parameters

 seg - the name of the segment (or directed segment) P1, P2 - two points

Description

 • A convex combination of two distinct points $\mathrm{P1}\left(\mathrm{x1},\mathrm{y1}\right)$ and $\mathrm{P2}\left(\mathrm{x2},\mathrm{y2}\right)$ is any point $\mathrm{P3}\left(\mathrm{x3},\mathrm{y3}\right)$ such that for some a in the range $0<=a<=1$, we have $\mathrm{x3}=a\mathrm{x1}+\left(1-a\right)\mathrm{x2}$ and $\mathrm{y3}=a\mathrm{y1}+\left(1-a\right)\mathrm{y2}$.
 • Given two distinct points P1 and P2, the line segment P1P2 is the set of convex combinations of P1 and P2. We call P1 and P2 the endpoints of segment P1P2.
 • Sometimes the ordering of P1 and P2 matters, and we speak of directed segment P1P2.
 • A line segment seg is defined by the two end points P1 and P2. Its two endpoints are P1 and P2.
 • A directed segment seg is defined by the two end points P1 and P2. The tail is P1 and the head P2.
 • To access the information relating to a segment (or directed segment) seg, use the following function calls:

 form(seg) returns the form of the geometric object (i.e., segment2d if seg is a line segment, and dsegment2d if seg is a directed segment. DefinedAs(seg) returns a list of two end points of seg if seg is a segment, and a list of the tail and head of seg if seg is a directed segment.

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

Examples

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

define two points A(0,0) and B(1,1)

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

define the segment AB

 > $\mathrm{segment}\left(\mathrm{AB},\left[A,B\right]\right)$
 ${\mathrm{AB}}$ (1)
 > $\mathrm{form}\left(\mathrm{AB}\right)$
 ${\mathrm{segment2d}}$ (2)
 > $\mathrm{DefinedAs}\left(\mathrm{AB}\right)$
 $\left[{A}{,}{B}\right]$ (3)
 > $\mathrm{map}\left(\mathrm{coordinates},\right)$
 $\left[\left[{0}{,}{0}\right]{,}\left[{1}{,}{1}\right]\right]$ (4)