From 4c555be335028dc1b3dd0afe78820910c1fed800 Mon Sep 17 00:00:00 2001 From: Bin Wang Date: Mon, 31 Oct 2011 00:00:00 +0000 Subject: [PATCH] version 1.11-12-7 --- DESCRIPTION | 6 +++--- MD5 | 8 ++++---- R/Internal.R | 6 +++--- R/spt.R | 8 ++++---- man/spt.Rd | 31 ++++++++++++++++++++++--------- 5 files changed, 36 insertions(+), 23 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 05553b5..a049491 100644 --- a/DESCRIPTION +++ b/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 . Maintainer: Bin Wang 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 diff --git a/MD5 b/MD5 index 8491d76..f74561d 100644 --- a/MD5 +++ b/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 diff --git a/R/Internal.R b/R/Internal.R index ce10980..439d3e5 100644 --- a/R/Internal.R +++ b/R/Internal.R @@ -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,]); @@ -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,]); @@ -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,]); diff --git a/R/spt.R b/R/spt.R index fb849a9..d859a85 100644 --- a/R/spt.R +++ b/R/spt.R @@ -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; @@ -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; } @@ -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],",", @@ -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; diff --git a/man/spt.Rd b/man/spt.Rd index d3d0f2b..3168e38 100644 --- a/man/spt.Rd +++ b/man/spt.Rd @@ -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{ @@ -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}