ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Primitive angle (Metapost)
@ 2016-02-08 17:25 Fabrice Couvreur
  0 siblings, 0 replies; only message in thread
From: Fabrice Couvreur @ 2016-02-08 17:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1.1: Type: text/plain, Size: 923 bytes --]

Hello,
I want to reproduce this figure.


​

In the example below, it seemed to me that he had to write
dir(180-angle(1,0.5)), but not.

\starttext

\startMPcode

path p ;
p := (3.5cm,-1.5cm)--(0cm,0.25cm)--1.2cm*dir(180-angle(1,0.5)) ;

draw p dashed evenly withcolor 0.625white;

draw p reflectedabout ((3.75cm,-1.5cm),(3.75cm,1.5cm)) dashed evenly
withcolor 0.625white ;

draw (-1cm,-1.5cm)--(8.5cm,-1.5cm)--(8.5cm,0.9cm)--(-1cm,0.9cm)--cycle
withcolor 0.625white ;

for i=0 upto 14 :
        draw unitsquare scaled 0.5cm shifted(i/2*cm,0*cm) ;
endfor ;

for i=0 upto 10 :
        draw unitsquare scaled 0.5cm shifted((i+2)/2*cm,-1/2*cm) ;
endfor ;

for i=0 upto 6 :
        draw unitsquare scaled 0.5cm shifted((i+4)/2*cm,-1*cm) ;
endfor ;

for i=0 upto 2 :
        draw unitsquare scaled 0.5cm shifted((i+6)/2*cm,-3/2*cm) ;
endfor ;

\stopMPcode

\stoptext


Thank you.

[-- Attachment #1.1.2: Type: text/html, Size: 1505 bytes --]

[-- Attachment #1.2: dalle.png --]
[-- Type: image/png, Size: 1657 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-02-08 17:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-08 17:25 Primitive angle (Metapost) Fabrice Couvreur

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).