This site is supported by donations to The OEIS Foundation.

Template:Polyline

From OeisWiki
Jump to: navigation, search

The {{polyline}} graphic template is used to draw a polyline. A polyline, which requires at least 2 points, is only closed if the last point equals the first point. (A closed polyline with at least 3 distinct points is a nondegenerate polygon, in which case you may/should use the {{polygon}} graphic template.)

Usage

{{polyline|n = n|points = x_1, y_1; ...; x_n, y_n|units = units|stroke = stroke|fill = fill}}

where:

  • n is the number of points considered (default: 0);
  • points are the points Cartesian coordinates x_1, y_1; ...; x_n, y_n (default: 0, 0);
  • units are the units associated with points (default: %). Units may be chosen among %, px, cm, mm or in;
  • stroke is the stroke style (default: 1px solid black);
  • fill is the fill style (default: none).

Examples

Code Result Comment
{{canvas|width = 100|height = 100|{{polyline}}}}
(nothing drawn,
needs at least two points)
{{canvas|width = 100|height = 100|{{polyline|0}}}}
(nothing drawn,
needs at least two points)
{{canvas|width = 100|height = 100|{{polyline|1|0, 0}}}}
(nothing drawn,
needs at least two points)
{{canvas|width = 100|height = 100|{{polyline|2|0, 0; 50, 0}}}}
 
{{canvas|width = 100|height = 100|{{rotate|{{polyline|2|0, 0; 50, 0}}|30}}}}
 
{{canvas|width = 100|height = 100|{{polyline|2|0, 0; 25, 25}}}}
 
{{canvas|width = 100|height = 100|{{polyline|3|45, 0; 0, 45; -45, 0}}}}
 
{{canvas|width = 100|height = 100|{{rotate|{{polyline|3|45, 0; 0, 45; -45, 0}}|45}}}}
 

Code



See also

Drawing templates






Affine transforms templates

See Help:CSS Transforms.