<!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 Standard Equilateral...</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"><tr><td>runif.std.tri</td><td style="text-align: right;">R Documentation</td></tr></table>

<h2>Generation of Uniform Points in the Standard Equilateral Triangle</h2>

<h3>Description</h3>

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


<h3>Usage</h3>

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


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>n</code></td>
<td>
<p>A positive integer representing the number of uniform points
to be generated in the standard equilateral triangle <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 pattern from which points are to be generated</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>tess.points</code></td>
<td>
<p>The vertices of the support region of
the uniformly generated points, it is the
standard equilateral triangle <i>T_e</i> for this function</p>
</td></tr>
<tr valign="top"><td><code>gen.points</code></td>
<td>
<p>The output set of generated points uniformly
in the standard equilateral triangle <i>T_e</i>.</p>
</td></tr>
<tr valign="top"><td><code>out.region</code></td>
<td>
<p>The outer region which contains the support region,
<code>NULL</code> for this function.</p>
</td></tr>
<tr valign="top"><td><code>desc.pat</code></td>
<td>
<p>Description of the point pattern
from which points are to be generated</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 points (here it is 3).</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 support, <i>T_e</i></p>
</td></tr>
</table>


<h3>Author(s)</h3>

<p>Elvan Ceyhan
</p>


<h3>See Also</h3>

<p><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);
n&lt;-100

set.seed(1)
Xdt&lt;-runif.std.tri(n)
Xdt
summary(Xdt)
plot(Xdt,asp=1)

Xlim&lt;-range(Te[,1])
Ylim&lt;-range(Te[,2])
xd&lt;-Xlim[2]-Xlim[1]
yd&lt;-Ylim[2]-Ylim[1]

Xp&lt;-runif.std.tri(n)$gen.points
plot(Te,asp=1,pch=".",xlab="",ylab="",xlim=Xlim+xd*c(-.01,.01),
ylim=Ylim+yd*c(-.01,.01))
polygon(Te)
points(Xp)


</pre>


</body></html>
