Skip to content

Commit

Permalink
version 1.11-12-7
Browse files Browse the repository at this point in the history
  • Loading branch information
Bin Wang authored and gaborcsardi committed Oct 31, 2011
1 parent 0112ec2 commit 4c555be
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 23 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
@@ -1,11 +1,11 @@
Package: spt
Version: 1.11-11-27
Version: 1.11-12-7
Date: 2011-10-31
Title: Sierpinski Pedal Triangle
Author: Bin Wang <bwang@jaguar1.usouthal.edu>.
Maintainer: Bin Wang <bwang@jaguar1.usouthal.edu>
Description: This package collects algorithms related to Sierpinski pedal triangle (SPT).
License: Unlimited
Packaged: 2011-11-28 02:53:26 UTC; bwang
Packaged: 2011-12-07 15:19:29 UTC; bwang
Repository: CRAN
Date/Publication: 2011-11-28 12:00:09
Date/Publication: 2011-12-07 17:07:28
8 changes: 4 additions & 4 deletions MD5
@@ -1,14 +1,14 @@
ca54e3508f13ce33eeb44f55a646a722 *DESCRIPTION
c2f3e99342feb1880b243e94af4b5538 *DESCRIPTION
d008ac6798fdfeba4fb80de7176f68c3 *LICENCE
2e46d215627025af7eed4bdd944b1b6e *NAMESPACE
97895c086bce04050e360ab99e1c9cd0 *PORTING
b74f4fe0bb2a629410fa2106df24cf72 *R/Internal.R
7017e98e13433919282e367a4f13967d *R/Internal.R
3a6346047fcaaaa61bfbcf03b4a0cc89 *R/chaos.R
fbed1be59b32771581d1db9b47d201f7 *R/spt.R
3f385022d7b97205e8b1322e92935fdd *R/spt.R
77bc384100be56dcd7172e0fda3ea56a *R/st.R
ee3784ad0fc5e1f68654fe3055a5481a *R/zzz.R
37235b5245ecc1a01b1e02271fff2464 *man/chaos.Rd
1ea79b894a0cf078b7dbe10e65259c85 *man/spt.Rd
92fddfc765dd5b42b2325f71aec78cfb *man/spt.Rd
63043f357827092c7edab5f5603e9f09 *man/st.Rd
8290d2e9740414e315237f0d5d4024bb *src/Makevars
b0683d1aff464dec94cf1417d7e6871f *src/init.c
Expand Down
6 changes: 3 additions & 3 deletions R/Internal.R
Expand Up @@ -3,7 +3,7 @@
if(n>1){
tmp = .Fortran(.F_PTChild, as.double(as.vector(tri1)), as.double(rep(0,6)));
result = matrix(tmp[[2]], ncol=2, nrow=3);
polygon(result[,1],result[,2])
polygon(result[,1],result[,2],col='gray')
tri1.1 = rbind(tri1[3,], result[2,], result[1,]);
tri1.2 = rbind(tri1[2,], result[1,], result[3,]);
tri1.3 = rbind(tri1[1,], result[3,], result[2,]);
Expand Down Expand Up @@ -33,7 +33,7 @@
if(n>1){
tmp = .Fortran(.F_SPTChild3, as.double(as.vector(tri1)), as.double(rep(0,6)));
result = matrix(tmp[[2]], ncol=2, nrow=3);
polygon(result[,1],result[,2])
polygon(result[,1],result[,2], col='gray')
tri1.1 = rbind(tri1[3,], result[2,], result[1,]);
tri1.2 = rbind(tri1[2,], result[1,], result[3,]);
tri1.3 = rbind(tri1[1,], result[3,], result[2,]);
Expand All @@ -49,7 +49,7 @@
if(n>1){
tmp = .Fortran(.F_SPTChild3, as.double(as.vector(tri1)), as.double(rep(0,6)));
result = matrix(tmp[[2]], ncol=2, nrow=3);
polygon(result[,1],result[,2])
polygon(result[,1],result[,2], col='gray')
tri1.1 = rbind(tri1[3,], result[2,], result[1,]);
tri1.2 = rbind(tri1[2,], result[1,], result[3,]);
tri1.3 = rbind(tri1[1,], result[3,], result[2,]);
Expand Down
8 changes: 4 additions & 4 deletions R/spt.R
Expand Up @@ -9,7 +9,7 @@ spt <- function(A,B){
as.character(format(180-A1-B1)),")",sep='')
angles = sort(c(A1,B1,C1),decreasing=TRUE)

minA = angles[1]; maxA = angles[3];
minA = angles[3]; maxA = angles[1];
r = pi/180; h=100;
C = angles[3]*r; B = angles[1]*r; A = angles[2]*r;
xa = 0; ya=0;
Expand All @@ -22,7 +22,7 @@ spt <- function(A,B){
if(maxA > 90){
delta = abs(h * sin(maxA))*.25
xmin = xmin - delta;
delta = (xmax-xmin-ymax+ymin)*.75;
delta = (xmax-xmin-ymax+ymin)*.8;
ymin = ymin - delta;
ymax = ymax + delta;
}
Expand All @@ -44,7 +44,7 @@ print.spt <- function(x,...){
tmp = data.frame(Angles=Angles,x=tmp[,1],y=tmp[,2])
row.names(tmp) = c("A","B","C")
cat("\n\t", x$data.name,"\n\n")
cat("Dimention = ", x$Dim,
cat("Dimension = ", x$Dim,
"\tViewport=(",x$viewport[1],",",
x$viewport[2],",",
x$viewport[3],",",
Expand All @@ -64,7 +64,7 @@ plot.spt <- function(x,iter,tol=0.0001,main=NULL,...){
plot(0,0, type='n', bty='n', xaxt='n',yaxt='n',
xlab='', ylab='', asp=1, main = main,
xlim=c(xmin,xmax), ylim=c(ymin,ymax))
polygon(x$ABC[,1], x$ABC[,2],...);
polygon(x$ABC[,1], x$ABC[,2]);
if(missing(iter)) iter = 11
if(iter < 1) stop("Iteration number can not be zero/negative.")
Tri0 = x$ABC;
Expand Down
31 changes: 22 additions & 9 deletions man/spt.Rd
Expand Up @@ -16,20 +16,28 @@
\item{A,B}{The degrees of two of the three angles of a triangle.}
}
\details{
When the original triangle is an acute triangle,
the area of the smallest SPT/PT to be drawn is determined by (tol * S),
where S is the total area for plotting. No restriction is applied to \code{iter}.

If the original triangle is an obtuse triangle,
the largest value of \code{iter} is 12.
When the original triangle is an acute triangle, the area of the
smallest SPT/PT to be drawn is determined by (tol * S), where S is
the total area for plotting. No restriction is applied to
\code{iter}.

tol: A stopping creiteria to draw the sub-SPT. Default value 0.0001.
If the original triangle is an obtuse triangle, the largest value of
\code{iter} is 12.

tol: A stopping creiteria to draw the sub-SPT. Default value
0.0001.


}
\value{
The dimension of the SPT will be returned if the original triangle
is an acute triangle.

The dimension of the SPT will be returned if the original triangle is
an acute triangle.

The viewport of showing the SPT/ST "abc" can be changed by changing
the value of abc$viewport.

}

\references{
Expand All @@ -43,7 +51,12 @@
\examples{

(abc = spt(50,60))
plot(abc, iter=10)
plot(abc, iter=7)

(abc = spt(50,10))
plot(abc, iter=3)
abc$viewport = c(0,-70,84,100)
plot(abc, iter=6)

}
\keyword{stats}
Expand Down

0 comments on commit 4c555be

Please sign in to comment.