<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Generation of Uniform Points in the first one-sixth of...</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="https://rpkg.net/assets/examples.css" />
</head><body>

<table width="100%" summary="page for runif.std.tri.onesixth"><tr><td>runif.std.tri.onesixth</td><td style="text-align: right;">R Documentation</td></tr></table>

<h2>Generation of Uniform Points in the first one-sixth of
standard equilateral triangle</h2>

<h3>Description</h3>

<p>An object of class <code>"Uniform"</code>.
Generates <code>n</code> points uniformly
in the first 1/6th of the standard equilateral triangle <i>T_e=(A,B,C)</i>
with vertices with <i>A=(0,0)</i>; <i>B=(1,0)</i>, <i>C=(1/2,&radic;{3}/2)</i>
(see the examples below).
The first 1/6th of the standard equilateral triangle is the triangle with vertices
<i>A=(0,0)</i>, <i>(1/2,0)</i>, <i>C=(1/2,&radic;{3}/6)</i>.
</p>


<h3>Usage</h3>

<pre>
runif.std.tri.onesixth(n)
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>n</code></td>
<td>
<p>a positive integer representing number of uniform points
to be generated
in the first one-sixth of <i>T_e</i>.</p>
</td></tr>
</table>


<h3>Value</h3>

<p>A <code>list</code> with the elements
</p>
<table summary="R valueblock">
<tr valign="top"><td><code>type</code></td>
<td>
<p>The type of the point pattern</p>
</td></tr>
<tr valign="top"><td><code>mtitle</code></td>
<td>
<p>The <code>"main"</code> title for the plot of the point pattern</p>
</td></tr>
<tr valign="top"><td><code>support</code></td>
<td>
<p>The vertices of the support of
the uniformly generated points</p>
</td></tr>
<tr valign="top"><td><code>gen.points</code></td>
<td>
<p>The output set of uniformly generated points
in the first 1/6th of
the standard equilateral triangle.</p>
</td></tr>
<tr valign="top"><td><code>out.region</code></td>
<td>
<p>The outer region for the one-sixth of <i>T_e</i>,
which is just <i>T_e</i> here.</p>
</td></tr>
<tr valign="top"><td><code>desc.pat</code></td>
<td>
<p>Description of the point pattern</p>
</td></tr>
<tr valign="top"><td><code>num.points</code></td>
<td>
<p>The <code>vector</code> of two numbers,
which are the number of generated points
and the number of vertices of the support (i.e., <code>Y</code>) points.</p>
</td></tr>
<tr valign="top"><td><code>txt4pnts</code></td>
<td>
<p>Description of the two numbers in <code>num.points</code>.</p>
</td></tr>
<tr valign="top"><td><code>xlimit,ylimit</code></td>
<td>
<p>The ranges of the <i>x</i>-
and <i>y</i>-coordinates of the generated,
support and outer region points</p>
</td></tr>
</table>


<h3>Author(s)</h3>

<p>Elvan Ceyhan
</p>


<h3>See Also</h3>

<p><code>runif.std.tri</code>, <code>runif.basic.tri</code>,
<code>runif.tri</code>, and <code>runif.multi.tri</code>
</p>


<h3>Examples</h3>

<pre>

A&lt;-c(0,0); B&lt;-c(1,0); C&lt;-c(1/2,sqrt(3)/2);
Te&lt;-rbind(A,B,C);
CM&lt;-(A+B+C)/3;
D1&lt;-(B+C)/2; D2&lt;-(A+C)/2; D3&lt;-(A+B)/2;
Ds&lt;-rbind(D1,D2,D3)
nx&lt;-100  #try also nx&lt;-1000

#data generation step
set.seed(1)
Xdt&lt;-runif.std.tri.onesixth(nx)
Xdt
summary(Xdt)
plot(Xdt,asp=1)

Xd&lt;-Xdt$gen.points

#plot of the data with the regions in the equilateral triangle
Xlim&lt;-range(Te[,1])
Ylim&lt;-range(Te[,2])
xd&lt;-Xlim[2]-Xlim[1]
yd&lt;-Ylim[2]-Ylim[1]

plot(Te,asp=1,pch=".",xlim=Xlim+xd*c(-.01,.01),
ylim=Ylim+yd*c(-.01,.01),xlab=" ",ylab=" ",
     main="first 1/6th of the \n standard equilateral triangle")
polygon(Te)
L&lt;-Te; R&lt;-Ds
segments(L[,1], L[,2], R[,1], R[,2], lty=2)
polygon(rbind(A,D3,CM),col=5)
points(Xd)

#letter annotation of the plot
txt&lt;-rbind(A,B,C,CM,D1,D2,D3)
xc&lt;-txt[,1]+c(-.02,.02,.02,.04,.05,-.03,0)
yc&lt;-txt[,2]+c(.02,.02,.02,.03,0,.03,-.03)
txt.str&lt;-c("A","B","C","CM","D1","D2","D3")
text(xc,yc,txt.str)


</pre>


</body></html>
