Back to draw-Gnuplot

'draw'-Gnuplot interface:
object polygon

Once you have opened a Maxima session, load package draw:

load("draw") $

To read the documentation on object polygon, write the following sentence:

describe(polygon) $

A convex polygon. Vertices are defined with a list of pairs of numbers:

draw2d(
  fill_color        = navy,
  color             = yellow,
  line_width        = 6,
  proportional_axes = xy,
  polygon([[1,1],[3,0],[4,5],[0,3]]) )$
polygon1

Concave polygon:

draw2d(
  fill_color = navy,
  color      = yellow,
  line_width = 6,
  proportional_axes = xy,
  polygon([[3,3],[3,0],[4,5],[0,3]]) )$
polygon2

Dotted and transparent star. Vertices are defined with two lists, for abscissas and ordinates:

draw2d(
  proportional_axes = xy,
  background_color  = brown,
  transparent       = true,
  line_width        = 3,
  line_type         = dots,
  color             = salmon,
  polygon([0,1,5,1,0,-1,-5,-1],
          [5,1,0,-1,-5,-1,0,1]) )$
polygon3

Ten random translations:

poly: polygon([[0,0],[1,1],[3,2],[3,-1]])$

draw2d(
  makelist(
    [transform = [x+random(10),y+random(10),x,y],
     poly],
    k, 10) )$
polygon4

Gaussian polygon of ten vertices:

load(distrib)$

draw2d(
  polygon(random_normal(0,1,10),
          random_normal(0,1,10)) )$
polygon5

© 2011-2016, TecnoStats.