Learn R Programming

pcds (version 0.1.8)

is.std.eq.tri: Check whether a triangle is a standard equilateral triangle

Description

Checks whether the triangle, tri, is the standard equilateral triangle \(T_e=T((0,0),(1,0),(1/2,\sqrt{3}/2))\) or not.

Usage

is.std.eq.tri(tri)

Value

TRUE if tri is a standard equilateral triangle, else FALSE.

Arguments

tri

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

Author

Elvan Ceyhan

Examples

Run this code
# \donttest{
A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2);
Te<-rbind(A,B,C)  #try adding +10^(-16) to each vertex
is.std.eq.tri(Te)

is.std.eq.tri(rbind(B,C,A))

Tr<-rbind(A,B,-C)
is.std.eq.tri(Tr)

A<-c(1,1); B<-c(2,0); C<-c(1.5,2);
Tr<-rbind(A,B,C);
is.std.eq.tri(Tr)
# }

Run the code above in your browser using DataLab