create a two-dimensional plot of objects supported in the geometry package
object to be plotted
[obj_1, ..., obj_n]
list of object(s) to be plotted
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.
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.
Define triangle T
Find the circumcircle of A1A2A3
Find the altitudes of T
Find the orthocenter and centroid of T
Find the medians of T
Check if H, OO, G are concurrent
Test if the distance between H and G is twice the distance between G and OO
An example of translation, rotation, and dilatation of circles
Angle ≔ table⁡:
n ≔ 8:
foritondoAnglei ≔ 2⁢Pi⁢inend do:dsegment⁡dseg,point⁡A,0,0,point⁡B,4,0:point⁡o,0,0:circle⁡c,o,1:homothety⁡c1,c,32,point⁡M,−1,0:homothety⁡c2,c,2,point⁡M,−1,0:homothety⁡c3,c,52,point⁡M,−1,0:translation⁡t,c,dseg:translation⁡tt,c1,dseg:translation⁡ttt,c2,dseg:translation⁡tttt,c3,dseg:forito8dorotation⁡t||i,t,Anglei,counterclockwise,o;rotation⁡tt||i,tt,Anglei,counterclockwise,o;rotation⁡ttt||i,ttt,Anglei,counterclockwise,o;rotation⁡tttt||i,tttt,Anglei,counterclockwise,oend do:draw⁡seq⁡op⁡t||i⁡color=red,tt||i⁡color=green,ttt||i⁡color=blue,tttt||i⁡color=plum,i=1..n,printtext=false,filled=true,axes=none,title=An example of translation, rotation, dilatation of a circle
Download Help Document
What kind of issue would you like to report? (Optional)