Learn R Programming

pcds (version 0.1.8)

tri2std.basic.tri: Converting a triangle to the standard basic triangle form form

Description

This function transforms any triangle, tri, to the standard basic triangle form.

The standard basic triangle form is \(T_b=T((0,0),(1,0),(c_1,c_2))\) where \(c_1\) is in \([0,1/2]\), \(c_2>0\) and \((1-c_1)^2+c_2^2 \le 1\).

Any given triangle can be mapped to the standard basic triangle form by a combination of rigid body motions (i.e., translation, rotation and reflection) and scaling, preserving uniformity of the points in the original triangle. Hence, standard basic triangle form is useful for simulation studies under the uniformity hypothesis.

Usage

tri2std.basic.tri(tri)

Value

A list with two elements

Cvec

The nontrivial vertex \(C=(c_1,c_2)\) in the standard basic triangle form \(T_b\).

orig.order

Row order of the input triangle, tri, when converted to the standard basic triangle form \(T_b\)

Arguments

tri

A \(3 \times 2\) matrix with each row representing a vertex of the triangle.

Author

Elvan Ceyhan

Examples

Run this code
# \donttest{
c1<-.4; c2<-.6
A<-c(0,0); B<-c(1,0); C<-c(c1,c2);

tri2std.basic.tri(rbind(A,B,C))
tri2std.basic.tri(rbind(B,C,A))

A<-c(1,1); B<-c(2,0); C<-c(1.5,2);
tri2std.basic.tri(rbind(A,B,C))
tri2std.basic.tri(rbind(A,C,B))
tri2std.basic.tri(rbind(B,A,C))
# }

Run the code above in your browser using DataLab