geometry - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Graphics : 2-D : geometry/draw

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.

• 

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

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

simplifydistanceH,G2distanceG,OO

drawCcolor='COLOR'RGB,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πinend do: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:forito8dorotationt||i,t,Anglei,counterclockwise,o;rotationtt||i,tt,Anglei,counterclockwise,o;rotationttt||i,ttt,Anglei,counterclockwise,o;rotationtttt||i,tttt,Anglei,counterclockwise,oend do:drawseqopt||icolor=red,tt||icolor=green,ttt||icolor=blue,tttt||icolor=plum,i=1..n,printtext=false,filled=true,axes=none,title=An example of translation, rotation, dilatation of a circle

See Also

geometry[objects]

geometry[transformation]

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam