How to randomize points in a given area?
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. Yue Wang
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
Yue Wang wrote:
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.
just use 'uniformdevisate' or metafun operators like 'ramdomized' ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hi, Hans:
On Sun, Nov 16, 2008 at 10:57 PM, Hans Hagen
Yue Wang wrote:
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.
just use 'uniformdevisate' or metafun operators like 'ramdomized'
How to ensure the point is in your christmas tree path?
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ 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 ___________________________________________________________________________________
Yue Wang
Yue Wang wrote:
Hi, Hans:
On Sun, Nov 16, 2008 at 10:57 PM, Hans Hagen
wrote: Yue Wang wrote:
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. just use 'uniformdevisate' or metafun operators like 'ramdomized'
How to ensure the point is in your christmas tree path?
if i remember right, by following the path of the tree ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Oh! Cool! Thank you, Hans, you really help!
On Mon, Nov 17, 2008 at 8:30 AM, Hans Hagen
Yue Wang wrote:
Hi, Hans:
On Sun, Nov 16, 2008 at 10:57 PM, Hans Hagen
wrote: Yue Wang wrote:
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. just use 'uniformdevisate' or metafun operators like 'ramdomized'
How to ensure the point is in your christmas tree path?
if i remember right, by following the path of the tree
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ 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 ___________________________________________________________________________________
participants (3)
-
Hans Hagen
-
Wolfgang Schuster
-
Yue Wang