Skip to content

Tool that simulates two-dimensional sample distribution based on a sample defined mesh

License

Notifications You must be signed in to change notification settings

YujiSODE/meshRandom

Repository files navigation

meshRandom

Tool that simulates two-dimensional sample distribution based on a sample defined mesh
GitHub: https://github.com/YujiSODE/meshRandom

Copyright (c) 2020 Yuji SODE <yuji.sode@gmail.com>
This software is released under the MIT License.
See LICENSE or http://opensource.org/licenses/mit-license.php


meshRandom_IMG_sampleGraphs.png

Figure 1. Four sample data sets and simulated random coordinates.
A. data set model: y=3.0*x+5.0.
B. data set model: y=3.0*x+5.0*U where U is random number in (0,1).
C. data set model: y=sin(x).
D. data set model: (x,y)=(0.25*cos(n*π/2.0),0.25*sin(n*π/2.0)) where n=0,1,2,....
y^ is simulated random coordinates.

1. Description

Tool that simulates two-dimensional sample distribution based on a sample defined mesh.

1-1. Shell

  • tclsh meshRandom.tcl N xyList;

1-2. Tcl

  • ::meshRandom::randoms N xyList;

    • $N: number of random coordinates to return
    • $xyList: a list of xy-coordinate data, and every element is expressed as x,y

2. Concept

Supposing that two-dimensional sample distribution is composed of four sample points P1 to P4.
Sample points P are linked by paths F.
Random coordinates P^ are generated along a path Fij.
P^ is included within a distribution P1P2P3P4.

meshRandom_IMG_conceptIMG

Figure 2. Diagram showing concept of meshRandom.
Filled circles show sample points. Red lines show sample paths Fij beteween two sample points Pi and Pj.

3. Script

It requires Tcl 8.6+.

4. Library list