From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: How to randomize points in a given area?
Date: Sat, 15 Nov 2008 14:57:31 +0100 [thread overview]
Message-ID: <3E652677-3248-42FE-8B49-1BD15B6F7E26@gmail.com> (raw)
In-Reply-To: <68bfdc900811141910k6cf6869bp4b48f6f55e6e2792@mail.gmail.com>
Am 15.11.2008 um 04:10 schrieb Yue Wang:
> Hi, Hans,
>
> In your "metapost graphics" pdf document, I can find a card which
> randomizes points in a path of Christmas tree, how to do that? thanks.
You could try to make something with this example code.
\setupcolors[state=start]
\starttext
\startMPpage[offset=1cm]
for i=1 upto 5000:
v := uniformdeviate(100) + 1 ;
h := uniformdeviate(v) / 5 * normaldeviate ;
l := uniformdeviate(5) ;
draw ((-l,0)--(l,0)) rotated uniformdeviate(180) shifted (h,-v)
withcolor transparent(1,.5,green) ;
endfor
\stopMPpage
\stoptext
Wolfgang
___________________________________________________________________________________
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 : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
next prev parent reply other threads:[~2008-11-15 13:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-15 3:10 Yue Wang
2008-11-15 13:57 ` Wolfgang Schuster [this message]
2008-11-16 14:57 ` Hans Hagen
2008-11-17 5:28 ` Yue Wang
2008-11-17 8:30 ` Hans Hagen
2008-11-17 12:13 ` Yue Wang
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=3E652677-3248-42FE-8B49-1BD15B6F7E26@gmail.com \
--to=schuster.wolfgang@googlemail.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).