draw - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


geometry

  

draw

  

create a two-dimensional plot of objects supported in the geometry package

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

draw(obj,...)

draw([obj_1,...,obj_n],...)

Parameters

obj

-

object to be plotted

[obj_1, ..., obj_n]

-

list of object(s) to be plotted

Description

• 

The routine draw provides the graphical visualization of all objects supported in the geometry package that have definite coordinates.

• 

A typical call to the draw function is draw([ obj_1( localopts_1 ), ..., obj_n( localopts_n )], globalopts) where obj_1, ..., obj_n are geometric objects, localopts_1, ..., localopts_n are local options for a particular object, and globalopts are options which apply to all of the objects.

• 

localopts_i is a sequence of type equation. The set of options allowed for localopts_i is color, legend, linestyle, numpoints, style, symbol, symbolsize, thickness, printtext, filled, transparency. Options legend, filled, and numpoints can only be provided as local options.

• 

The printtext option, when set to true, allows the "text" to be printed out; e.g., when a triangle is drawn, the names of its vertices will also be printed. The default mode is false.

• 

The filled option applies to closed curves (i.e., triangles, squares, circles, and ellipses).  When using this option, it is important to note that the order in which the objects are given is important, as the first object in the call to draw is drawn on top of the other objects.  For example, if you wanted to plot two filled circles (e.g., a small circle contained inside of a larger circle), then you would make the small circle the first object, and the large circle as the second object.  Reversing the order of the objects would "hide" the small circle.

• 

For detailed descriptions of other options, see plot/options.

• 

globalopts: the set of options allowed for globalopts is the same as that for plot except for the adaptive and sample options.  See plot/options for detailed descriptions of each option.

• 

Note that the localopts_i that are defined for an object have precedence over globalopts when obj_i is drawn.

Examples

An example for the following theorem.  These are the commands to create the plot from the Plotting Guide.

Theorem: The orthocenter H, the circumcenter OO, and the centroid G of a triangle A1A2A3 are collinear and HG = 2*GOO.

withgeometry:

Define triangle T

triangleT,pointA2,0,0,pointA1,2,4,pointA3,7,0:

Find the circumcircle of A1A2A3

circumcircleC,T,centername=OO:

Find the altitudes of T

altitudeA2A22,A2,T,A22:

altitudeA3A33,A3,T,A33:

altitudeA1A11,A1,T,A11:

Find the orthocenter and centroid of T

orthocenterH,T:centroidG,T:

Find the medians of T

medianA1M1,A1,T,M1:

medianA2M2,A2,T,M2:

medianA3M3,A3,T,M3:

dsegmentdsg1,OO,H:dsegmentdsg2,H,G:

dsegmentOM1,OO,M1:dsegmentOM2,OO,M2:

dsegmentOM3,OO,M3:

triangleT1,M1,M2,M3:

Check if H, OO, G are concurrent

AreCollinearOO,H,G

true

(1)

Test if the distance between H and G is twice the distance between G and OO

simplifydistanceH,G2distanceG,OO

0

(2)

drawCcolor=COLORRGB,1.00000000,1.00000000,0.8000000000,filled=true,Tcolor=blue,T1,A3M3,A2M2,A1M1,A2A22,A3A33,A1A11,dsg1style=line,color=green,thickness=3,dsg2thickness=3,color=green,OM1,OM2,OM3,axes=none,printtext=true

An example of translation, rotation, and dilatation of circles

Angletable:

n8:

foritondoAnglei2πinenddo:dsegmentdseg,pointA,0,0,pointB,4,0:pointo,0,0:circlec,o,1:homothetyc1,c,32,pointM,1,0:homothetyc2,c,2,pointM,1,0:homothetyc3,c,52,pointM,1,0:translationt,c,dseg:translationtt,c1,dseg:translationttt,c2,dseg:translationtttt,c3,dseg:forito8dorotationti,t,Anglei,counterclockwise,o;rotationtti,tt,Anglei,counterclockwise,o;rotationttti,ttt,Anglei,counterclockwise,o;rotationtttti,tttt,Anglei,counterclockwise,oenddo:drawseqopticolor=red,tticolor=green,ttticolor=blue,tttticolor=plum,i=1..n,printtext=false,filled=true,axes=none,title=An example of translation, rotation, and dilatation of a circle

See Also

geometry/objects

geometry/transformation