search for: cos

Displaying 20 results from an estimated 1679 matches for "cos".

Did you mean: com
2007 Sep 22
0
error messages
...function. It looks like the outcome depends on the initial values given. My program is shown below: library(circular) ######################################## 4 parameters ######################################## z<-rvonmises(100,0,1) z<-as.vector(z) x<-rvonmises(100,0,2+cos(z)) x<-as.vector(x) f<-function(x){ k1<-x[1] k2<-x[2] k12<-x[3] g<-x[4] -2*sum(log( exp(k1*cos(x))*integrate(function(y)exp((k2+k12*cos(x))*cos(y)),g,2*pi,subdivisions=1000000)$value /(2*pi*integrate(function(y)besselI(k1+k12*cos(y),0)*exp(k2*cos(y)),g,2*pi,subdi...
2001 Apr 30
2
plotting an expression
I am sure it is just me not understanding how R works, but could somebody explain why curve(cos(x)) works and curve(expression(cos(x)) does not? I have done some investigating and here is what I found. If I comment out the line of curve indicated below, both calls work fine. function (expr, from, to, n = 101, add = FALSE, type = "l", ylab = NULL, log = NULL, xlim = NU...
2009 Jul 14
4
Trig functions strange results
I am trying to calculate coordinate transformations and in the process of debugging my code using debug I found the following Browse[1]> direction[i] [1] -1.570796 Browse[1]> cos(direction[i]) [1] 6.123032e-17 Browse[1]> cos(-1.570796) [1] 3.267949e-07 Browse[1]> direction[i] [1] -1.570796 Browse[1]> cos(direction[i]) [1] 6.123032e-17 Browse[1]> cos(-1.570796) [1] 3.267949e-07 Browse[1]> x<-direction[i] Browse[1]> x [1] -1.570796 Browse[1]> cos(x) [1...
2010 Nov 15
2
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
In http://llvm.org/docs/tutorial/LangImpl4.html#jit there's an example that optimizes calls to functions without side effects. Specifically, ready> extern sin(x); ready> extern cos(x); ready> def foo(x) sin(x)*sin(x) + cos(x)*cos(x); Read function definition: define double @foo(double %x) { entry: %calltmp = call double @sin(double %x) %multmp = fmul double %calltmp, %calltmp %calltmp2 = call double @cos(double %x) %multmp4 = fmul double %ca...
2010 Dec 20
2
Sine Regression in R
...e function on one year of wind data. I have two questions below. Looking around on the net I managed to get the following: Sine Equation: y = a + b * sin( c + d*x ) b is the amplitude, c is the phase shift, d is something deal with periodicty of data*.* This can be linearised by sin( c+dx ) = cos(c) * sin(dx) + sin(c) * cos(dx). If one calls dx = x1 y = a + b * sin( c + d*x ) y = a + b * [cos(c) * sin(x1) + sin(c) * cos(x1)] y = a + b * cos(c) * sin(x1) + b * sin(c) * cos(x1) y = a + b1 * sin(x1) + b2 * cos(x1) where b1 = b * cos(c) and b2 = b * sin(c) This works fine for me as I...
2007 Oct 07
1
Arguments to "personalised" plot()
...functions, in particular plot(), to save repetitively typing the same options over and over again. For example: plotb <- function(x,...){plot(x,pch="+",col="blue",...)} This does exactly what you'd expect it to do when fed with a vector of values to plot, e.g. plotb(cos(0.01*2*pi*(0:100))) namely a plot of the values of cos(..) with x-coordinates marked 0, 20, 40, 60, 80, 100, as blue "+". As expected, one can add other plot options if needed, e.g. plotb(cos(0.01*2*pi*(0:100)), xlim=c(0,4*pi)) if one wants. In this case, I'm supposing that the...
2008 Oct 26
0
orthographic projection of ellipsoids
...t very efficient or satisfying. I think I'm on the wrong track from the start. Is there an obvious analytical parametrisation of such projections? Any comments are welcome. Many thanks, baptiste > > rotM3d <- function(theta=0, phi=0, psi=0){ # 3D rotation matrix > a11 <- cos(psi)*cos(phi) - cos(theta)*sin(phi)*sin(psi) > a12 <- cos(psi)*sin(phi) + cos(theta)*cos(phi)*sin(psi) > a13 <- sin(psi)*sin(theta) > a21 <- -sin(psi)*cos(phi) - cos(theta)*sin(phi)*cos(psi) > a22 <- -sin(psi)*sin(phi) + cos(theta)*cos(phi)*cos(psi) > a23 <- cos(p...
2010 Jan 29
1
callerid not working over sip
...-- Executing [170 at internal:3] Set("DAHDI/1-1", "CALLERID="Test" <447>") in new stack -- Executing [170 at internal:4] Dial("DAHDI/1-1", "SIP/office-home-sip/170") in new stack == Using SIP RTP TOS bits 184 == Using SIP RTP CoS mark 5 == Using SIP VRTP TOS bits 136 == Using SIP VRTP CoS mark 4 == Using UDPTL TOS bits 184 == Using UDPTL CoS mark 5 -- Called office-home-sip/170 On the office asterisk: == Using SIP RTP TOS bits 184 == Using SIP RTP CoS mark 5 == Using SIP VRTP CoS mark 6 == Usi...
1999 Oct 05
3
problem with outer and image
I want to make a picture of a cos wave grating (pattern of fuzzy stripes). First I try to make a plot of a cos wave: x<-seq(1:100) y<- 10*cos(2*pi*x*3/length(x)+0)+300 plot(x,y) That works fine. 3 cycles of cos wave. Now try for grating. time<-seq(1:100) f<-function(x,time) 10*cos(2*pi*x*3/length(x)+0)+300 z<-outer(...
2011 Dec 27
1
how to used SIPp for sip load testing
...tart call testing .... when i start SIPp then found verious hits on myserver. *CLI:- * [Dec 27 17:37:54] NOTICE[28001]: chan_sip.c:20785 handle_request_invite: Call from '' to extension 'service' rejected because extension not found in context 'default'. == Using SIP RTP CoS mark 5 [Dec 27 17:37:54] NOTICE[28001]: chan_sip.c:20785 handle_request_invite: Call from '' to extension 'service' rejected because extension not found in context 'default'. == Using SIP RTP CoS mark 5 [Dec 27 17:37:54] NOTICE[28001]: chan_sip.c:20785 handle_request_invit...
2011 Nov 05
1
3-D ellipsoid equations
+ Hello, The parametric equations of an ellipsoid can be written in terms of spherical coordinates. The three spherical coordinates are converted to Cartesian coordinates by X=a cos (α) sin(θ) Y=b sin(α) sin(θ) Z=c cos(θ) for α and θ The parameter α varies from 0 to 2 π and θ varies from 0 to π . Here ( X o , Y o ,Z o ) is the center of the ellipsoid, and θ is the angle of rotation. I need to come up with an expression for the ellipsoid expressed parametrically as th...
2005 Mar 29
1
strange result of acos
Hi all, I have to calculate an expression using acos -function. A strange result of acos appears *1. case with error* ss <- sin(10.74*pi/180)**2 +(cos(10.74*pi/180)*cos(10.74*pi/180)*cos(0*pi/180)) ss acos(ss) [1] NaN Warning message: NaNs produced in: acos(ss) *2. case without error* ss <- sin(10.7*pi/180)**2 +(cos(10.7*pi/180)*c...
2016 Dec 01
2
Different results for cos,sin,tan and cospi,sinpi,tanpi
Hi, i try sin, cos, and tan. > sapply(c(cos,sin,tan),function(x,y)x(y),1.23e45*pi) [1] 0.5444181 0.8388140 1.5407532 However, *pi results the following > sapply(c(cospi,sinpi,tanpi),function(x,y)x(y),1.23e45) [1] 1 0 0 Please try whether the following becomes all right. diff -ruN R-3.3.2.orig/src/nmath/cos...
2010 Nov 15
0
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
Hi Rob, You need to set attribute ReadOnly on the sin / cos functions, using Function::addFnAttr(Attribute) for example. Best regards, -- Arnaud de Grandmaison -----Original Message----- From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Rob Pieke Sent: Monday, November 15, 2010 11:41 AM To: llvmdev at cs.uiuc.edu Su...
2011 Jan 20
1
Generating time progressing line for Google Earth
...####### #degrees to radians Radians <- function (degree) { radian = degree * (pi/180.0) return(radian) } #radians to degrees Degrees <- function (radian) { degree = radian * (180.0/pi) return(degree) } # Calculates the distance between two points using the # Spherical Law of Cosines gcd.slc <- function(lon1, lat1, lon2, lat2) { R = 6371.0 # Earth mean radius [km] lon1 = Radians(lon1) lat1 = Radians(lat1) lon2 = Radians(lon2) lat2 = Radians(lat2) d = acos(sin(lat1)*sin(lat2) + cos(lat1)*cos(lat2) * cos(lon2-lon1)) * R...
2010 Jun 02
4
Draw text with a box surround in plot.
text() can draw text on a plot. Do we have a way/function to draw text with a box surround it? Thanks, -james
2011 Feb 25
5
Substituting inside expression
I am having following problem: I?m constructing model for calculation of area of triangle. I know sides a, b, and gamma angle. I wish to calculate the area using heron?s formula: S <- sqrt(s*(s-a)*(s-b)*(s-c)) where s <- (a+b+c)/2 and c is calculated using law of cosines: c <- sqrt(a^2 + b^2 -2*a*b*cos(gamma)) since i am calculating a regression model, i need derivation of this expression for area S. something like (D(expression.S,c("a","b"))) To write it all into a single expression, it is too complicated, so i would like to use some k...
2020 Oct 23
2
3d plot of earth with cut
...: # Let vec(P0) = (P0x, P0y, P0z) be a point given in the plane of the longitude # let vec(n) = (nx, ny, nz) an orthogonal vector to this plane # then vec(P) = (Px, Py, Pz) will be in the plane if (vec(P) - vec(P0)) * vec(n) = 0 # We pick 2 arbitrary vectors in the plane out of 3 points p0x <- r*cos(2)*cos(fixlong) p0y <- r*cos(2)*sin(fixlong) p0z <- r*sin(2) p1x <- r*cos(2.5)*cos(fixlong) p1y <- r*cos(2.5)*sin(fixlong) p1z <- r*sin(2.5) p2x <- r*cos(3)*cos(fixlong) p2y <- r*cos(3)*sin(fixlong) p2z <- r*sin(3) # Make the vectors pointing to P and P0 v1x <- p1x - p0x...
2011 Jul 27
2
fitting sine wave
...minima and maxima respectively. This is what I?ve got so far. And I would keep doing so, but sadly nls() then says that it has reached the maximum number of Iterations? ? m<-c(-0.2061826,0.5888406,0.2026079,1.0000000,0.2342754,0.6865078,-0.1265754) x <- c(1,2,3,4,5,6,7) p <- nls(m~k1*x+k2*cos(x)+k3*sin(x)+k4*cos(2*x)+k5*sin(2*x)+k6*cos(3*x),start = list(k1=0,k2=0,k3=0.1,k4=0.1,k5=0,k6=0)) par ?<- c(pk1=summary(p)$parameters[1,1],pk2=summary(p)$parameters[2,1],pk3=summary(p)$parameters[3,1],pk4=summary(p)$parameters[4,1],pk5=summary(p)$parameters[5,1],pk6=summary(p)$parameters[6,1]) x...
2020 Sep 09
3
constrained cosine rounding mode behavior
Hi: I am trying to implement interval arithmetic through llvm. I have a problem with the rounding mode with llvm.experimental.constrained.cos I have two pieces of codes: ; Function Attrs: norecurse nounwind readnone ssp uwtable define double @cosine_down(double returned) local_unnamed_addr #0 {   ; call the llvm intrinsic to perform downward cosine   %2 = call double @llvm.experimental.constrained.cos(double %0, metadata !"round.d...