ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Fabrice Couvreur <fabrice1.couvreur@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Primitive angle (Metapost)
Date: Mon, 8 Feb 2016 18:25:16 +0100	[thread overview]
Message-ID: <CACyK-eqhZRZVH613fwcigxvPK3ByiOod32W-GXeFFDBx257N0Q@mail.gmail.com> (raw)


[-- 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
___________________________________________________________________________________

                 reply	other threads:[~2016-02-08 17:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACyK-eqhZRZVH613fwcigxvPK3ByiOod32W-GXeFFDBx257N0Q@mail.gmail.com \
    --to=fabrice1.couvreur@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).