File:Transformation example in MetaPost.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(SVG file, nominally 183 × 73 pixels, file size: 7 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

Description
Русский: Пример использования линейных преобразований в MetaPost. Сначала создаётся простой рисунок, затем он масштабируется и наклоняется для имитации трёхмерии. Исходный код для создания SVG-рисунка:
Date
Source Own work
Author Evgeny Baldin
SVG development
InfoField
 
The SVG code is valid.
 
This vector image was created with MetaPost.
Source code
InfoField

PostScript code

defaultfont := "cmr12";
 defaultscale := 12pt /fontsize defaultfont;
 prologues := 3;
 outputformat := "svg";
 %пример использования slanted
 beginfig(1) ;
  numeric u;
  u = 0.8mm;
  cutdraw (0u,0u)--(20u,0u)--(20u,30u){dir 90}..
      {dir -90}(17u,30u)--(17u,3u)--(0u,3u)
  withpen pencircle scaled 0.5u;
  drawdblarrow (23u,10u)--(23u,1u);
  label.rt("h",1/2[(23u,10u),(23u,1u)]);
  drawdblarrow (30u,30u)--(30u,1u);
  label.lft("H",1/2[(30u,30u),(30u,1u)]);
  picture Base;
  Base:=currentpicture;
  clearit;
  fill (15u,0u)--(20u,0u)--(20u,20u)--(17u,20u)--(17u,3u)--(15u,3u)--cycle
   withcolor 0.7white;
  draw Base;
  draw ((12u,20u)--(20u,20u));
  draw ((12u,10u)--(20u,10u));
  drawdblarrow ((14u,20u)--(14u,10u));
  label.lft("d",(14u,16u));
  picture Slant;
  Slant=currentpicture;
  clearit;
  fill (5u,0u)--(20u,0u)--(20u,10u)--(17u,10u)--(17u,3u)--(5u,3u)--cycle
  withcolor 0.7white;
  draw Base;
 % Собственно говоря, приер линейных преобразований здесь.
  draw Slant yscaled 2/3 slanted 1/2 shifted (40u,0u);
 endfig;

Affine transformations example usage in MetaPost code

defaultfont := "cmr12";
 defaultscale := 12pt /fontsize defaultfont;
 prologues := 3;
 outputformat := "svg";
 beginfig(1) ;
  numeric u;
  u = 0.8mm;
  cutdraw (0u,0u)--(20u,0u)--(20u,30u){dir 90}..
      {dir -90}(17u,30u)--(17u,3u)--(0u,3u)
  withpen pencircle scaled 0.5u;
  drawdblarrow (23u,10u)--(23u,1u);
  label.rt("h",1/2[(23u,10u),(23u,1u)]);
  drawdblarrow (30u,30u)--(30u,1u);
  label.lft("H",1/2[(30u,30u),(30u,1u)]);
  picture Base;
  Base:=currentpicture;
  clearit;
  fill (15u,0u)--(20u,0u)--(20u,20u)--(17u,20u)--(17u,3u)--(15u,3u)--cycle
   withcolor 0.7white;
  draw Base;
  draw ((12u,20u)--(20u,20u));
  draw ((12u,10u)--(20u,10u));
  drawdblarrow ((14u,20u)--(14u,10u));
  label.lft("d",(14u,16u));
  picture Slant;
  Slant=currentpicture;
  clearit;
  fill (5u,0u)--(20u,0u)--(20u,10u)--(17u,10u)--(17u,3u)--(5u,3u)--cycle
  withcolor 0.7white;
  draw Base;
 % here it is transformation example
  draw Slant yscaled 2/3 slanted 1/2 shifted (40u,0u);
 endfig ;

Licensing[edit]

I, the copyright holder of this work, hereby publish it under the following licenses:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.
You may select the license of your choice.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current09:42, 4 January 2011Thumbnail for version as of 09:42, 4 January 2011183 × 73 (7 KB)Evgueni (talk | contribs){{Information |Description={{ru|1=Пример использования линейных преобразований в MetaPost. Сначала создаётся простой рисунок, затем он масштабируется и накл�

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file: