search for: atan

Displaying 20 results from an estimated 117 matches for "atan".

Did you mean: alan
2005 May 16
1
branch cuts of atan()
Hi the following gave me a shock: > atan(2) [1] 1.107149 > atan(2+0i) [1] -0.4636476+0i > or, perhaps more of a gotcha: > atan(1.0001+0i) [1] -0.7853482+0i > atan(0.9999+0i) [1] 0.7853482+0i > evidently atan()'s branch cuts aren't where I thought they were. Where do I look for documentation on this? --...
2004 Dec 16
3
Qyery on bark equation in floor0 code
Hi All, I need some clarifications regarding the mismatch I found in the code and the specification. (a) In the specification, the bark(x) equation is given as: bark(x) = 13.1 atan(.00074x) + 2.24 atan(.0000000158(x^2)) + .0001x whereas in the code it is given as: #define toBARK(n) (13.1f*atan(.00074f*(n))+2.24f*atan((n)*(n)*1.85e-8f)+1e-4f*(n)) Which one of these is the proper one ? (b) Also, we are planning to implement a fixed point code for the Vorbis decoder. And as...
2004 Jan 21
2
derivative of atan(x) and similar functions
Dear R experts. 'D()' function recognizes some of the analitical functions, such as sin, cos, etc. But I'd like to take analytical derivatives from asin, atan etc. functions. Are there any R packages providing that features? Thanks. -- Timur.
2000 Nov 26
2
References for the BARK/MEL stuff
Could someone point me to the BARK/MEL tables that these macros (from vorbis/scales.h) are trying to approximate? #define toBARK(f) (13.1*atan(.00074*(f))+2.24*atan((f)*(f)*1.85e-8)+1e-4*(f)) #define fromBARK(z) (102.*(z)-2.*pow(z,2.)+.4*pow(z,3)+pow(1.46,z)-1.) #define toMEL(f) (log(1.+(f)*.001)*1442.695) #define fromMEL(m) (1000.*exp((m)/1442.695)-1000.) I was wondering if I could come up with different functions that were easier...
2009 Sep 23
1
Numerical integration problem
...m on my machine running R 2.9.0. Any suggestions on what might be causing this and what I can do to avoid it would be very gratefully received. Hoping for some insights Marcus ########################## #Problem example #Works fine: integrate(hazard, 0,Inf, v=0.1, gam=pi*232/200, pos=list(r=5,th=atan(3/4)), a=10, b0=10, bt=0.1) #Gives error "...integral probably divergent": integrate(hazard, 0,Inf, v=0.1, gam=pi*231/200, pos=list(r=5,th=atan(3/4)), a=10, b0=10, bt=0.1) #Plot the integrands - doesn't look obviously problematic h <- hazard(seq(0,500,0.1),0.1,pi*231/200,pos=list...
2007 Jan 19
3
integrate and quadratic forms
...of a quadratic form following Imhof's (1961, Biometrika 48) procedure. The parameters are: lambda=c(.6,.3,.1) h=c(2,2,2) sigma=c(0,0,0) q=3 I've implemented Imhof's procedure two ways that, for me, should give the same answer: #more legible integral1 = function(u) { o=(1/2)*sum(h*atan(lambda*u)+sigma^2*lambda*u/(1+lambda^2*u^2)) - q*u/2 rho=prod((1+lambda^2*u^2)^(h/4))*exp( (1/2)*sum((sigma*lambda*u)^2/(1+lambda^2*u^2)) ) integrand = sin(o)/(u*rho) } #same as above integral2= function(u) { ((1/2)*sum(h*atan(lambda*u)+sigma^2*lambda*u/(1+lambda^2*u^2)) - q*u/2)/ (u*(prod((1...
2006 Mar 28
2
atan2(1,1i)
Hi ?atan2 says that atan2(y,x)=atan(y/x) for x and y numeric or complex vectors. Well, I would expect atan2(1,1i) to be equal to atan(-1i), but > atan2(1,1i) Error in atan2(y, x) : Non-numeric argument to mathematical function > R.version _ platform powerpc-apple-darwin8.5....
2006 Mar 28
2
atan2(1,1i)
Hi ?atan2 says that atan2(y,x)=atan(y/x) for x and y numeric or complex vectors. Well, I would expect atan2(1,1i) to be equal to atan(-1i), but > atan2(1,1i) Error in atan2(y, x) : Non-numeric argument to mathematical function > R.version _ platform powerpc-apple-darwin8.5....
2008 May 27
5
Rotated text on a regression line
...rary x and y values y=x*2-rnorm(1:10) plot(x,y,pch=16,xlim=c(0,10)) #create the graph abline(lm(y~x)) #calculate the y coordinate of the text: yval=predict(lm(y~x),list(x=rep(2,length(x))))[1] #calculate the slope: slope=as.numeric(lm(y~x)[[1]][2]) text(2,yval,"Regression",srt=180/pi*atan(slope),adj=0) #### What am I doing wrong here? Many thanks in advance for any help! Best wishes Christoph (using R 2.6.1 on Windows XP)
2004 Apr 11
3
pcauchy precision (PR#6756)
..._Name: Morten Welinder Version: snapshot OS: Submission from: (NULL) (65.213.85.129) Two things are wrong. 1. There is nan test outside IEEE_754. 2. The meat part of the function should really be something like... if (!lower_tail) x = -x; if (fabs (x) > 1) { double temp = atan (1 / x) / M_PI; return (x > 0) ? R_D_Clog (temp) : R_D_val (-temp); } else return R_D_val (0.5 + atan (x) / M_PI); ...instead of the current heavily truncated series expansion. The above is much simpler and more precise. (Thanks to Ian Smith for pointing the in-hindsight- obviou...
2014 Jan 09
0
Handling UMAD with a negative modifier, or why glsl-fs-atan-3 was failing
So I figured out what was going on. The shader has a UMAD TEMP[0].x, TEMP[0].xxxx, -TEMP[5].xxxx, TEMP[0].xxxx instruction, in which the -TEMP[5].xxxx got emitted as cvt neg u32 $r1 u32 $r1 If instead I fudge mkOp() to force a s32 dtype on OP_NEG, everything starts to work. Similarly, if I fudge emitCVT to basically do the same thing, it also works. (Of note -- changing both stype and dtype to
2005 Apr 14
1
Strange behavior of atan2
Dear all, I've got a problem with the function atan2. For a couple of coordinates x and y, This function returns the angle between the vector of coordinates (x, y) and the abscissa axis, i.e. it is the same as atan(y/x) (as indicated on the help page). If we consider the vector with coordinates x = 0 and y = 0, we have the following result: &g...
2007 Feb 01
3
Need help writing a faster code
...c, but with no success. Here is an example: m <- 2000 n <- 5000 A <- matrix(rnorm(2*m),ncol=2) B <- matrix(rnorm(2*n),ncol=2) W <- matrix(NA, m, n) for (i in 1:m) { W[i,] <- apply(B, 1, y=A[i,], function(x,y) g(y,x)) } g <- function(x,y){ theta <- atan((y[2]-x[2]) / (y[1] - x[1])) theta + 2*pi*(theta < 0) } Thanks for any suggestions. Best, Ravi. ---------------------------------------------------------------------------- ------- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriat...
2014 Mar 20
2
BARK implementation (or specification) error
...bed in the Vorbis specification and its implementation in libvorbis. In the specificationhttp://xiph.org/vorbis/doc/Vorbis_I_spec.pdf bark(x) = 13.1arctan(.00074x) + 2.24arctan(.0000000185x**2 + .0001x) In the libvorbis code http://svn.xiph.org/trunk/vorbis/lib/scales.h #define toBARK(n) (13.1f*atan(.00074f*(n))+2.24f*atan((n)*(n)*1.85e-8f)+1e-4f*(n)) You will note that the last term is inside the parentheses of the second arctan function in the specification but outside in the libvorbis implementation. This results in extremely large differences at high frequencies. Which is correct: the spe...
2001 Aug 12
3
gam() and library( modreg )
Hi, I'm just wonder if there is an R equivalent function of gam() - which exist in Splus. Also does anyone know if the library( modreg ), which comes with the installation file of R 1.3.0 (Windows version), exists in the previous versions of R (again, Windows version)? Or does one need to install the library into the previous versions of R explicitly? Thanks, Ko-Kang Wang
1997 Apr 23
1
R-beta: Version 0.49 Released
...d" should match that in S. Group methods for "Math", "Ops" and "Summary" are available. o Complex arithmetic is now implemented. Many mathematical functions are now defined for complex arguments (e.g. sqrt, exp, log, sin, cos, tan, asin, acos, atan). There is no complex gamma function or log gamma function yet. The summary functions "mean", "sum", "prod", "cumsum" and "cumprod" work correctly when (some of) their arguments are complex. Other functions such as "solve&quo...
1997 Apr 23
1
R-beta: Version 0.49 Released
...d" should match that in S. Group methods for "Math", "Ops" and "Summary" are available. o Complex arithmetic is now implemented. Many mathematical functions are now defined for complex arguments (e.g. sqrt, exp, log, sin, cos, tan, asin, acos, atan). There is no complex gamma function or log gamma function yet. The summary functions "mean", "sum", "prod", "cumsum" and "cumprod" work correctly when (some of) their arguments are complex. Other functions such as "solve&quo...
1997 Apr 23
1
R-beta: Version 0.49 Released
...d" should match that in S. Group methods for "Math", "Ops" and "Summary" are available. o Complex arithmetic is now implemented. Many mathematical functions are now defined for complex arguments (e.g. sqrt, exp, log, sin, cos, tan, asin, acos, atan). There is no complex gamma function or log gamma function yet. The summary functions "mean", "sum", "prod", "cumsum" and "cumprod" work correctly when (some of) their arguments are complex. Other functions such as "solve&quo...
2009 Aug 27
2
setting par(srt) according to plot aspect ratio
...ect ratio, but puts the text at the wrong angle if the plot region is short and wide or tall and narrow. I can't find a par() component containing the plot aspect ratio. It will be for png() or postscript() output, if that matters. f <- function(x) x g <- function(x) 2*x (f_angle <- atan(1)*180/pi) (g_angle <- atan(2)*180/pi) xpos <- 0.2 plot(f) plot(g,add=TRUE) par(srt=f_angle) text(xpos,f(xpos),label="y=x",pos=3) par(srt=g_angle) text(xpos,g(xpos),label="y=2x",pos=3) -- Levi Waldron post-doctoral fellow Jurisica Lab, Ontario Cancer Institute Division...
2005 Sep 01
3
ntlm_auth and high load fault
...ined to 2k3 AD. > > >My ideas about why this happens are exausted (all of them are >unproductive >:). >ANYBODY, please, if you have similar, or heard about this >situation, please >let me know. >May be some ideas about fighting against it? > >Thnx in advance. >/aTan > >-- >To unsubscribe from this list go to the following URL and read the >instructions: https://lists.samba.org/mailman/listinfo/samba >