cdalitz
• Member for 2 years, 8 months
• Last seen this week

203 views

With the substitution $y=x+t$, the $t$-dependency can be factored out: $$I(t)=\int_{-\infty}^\infty e^{-(y-t)}F(y)\;dy = e^t \int_{-\infty}^\infty e^{-y}F(y)\;dy = C\cdot e^t$$ This still leaves ...

94 views

A necessary condition for $\lfloor a/b\rfloor = \lfloor c/d\rfloor$ is $|ad-bc| < db$. This is not sufficient however, so if this test yields true (or if one of the multiplications overflows), you ...

106 views

This integral has a closed analytic solution. The trick is to write $$\frac{1}{x^3+ ax + 2a} = \frac{A}{x-x_1} + \frac{B}{x-x_2} + \frac{C}{x-x_3}$$ by a method called partial fraction decomposition. ...

237 views

If file size is an issue, you can use the zlib library functions gzopen, gzwrite, gzread, and gzclose to directly write and read the text to a compressed file. Apart from possibly saving even more ...

124 views

You are looking for Chamfer-Matching: it will yield a zero value at all center points where the pattern occurs. Ordinary template matching (aka cross correlation) does not work in your case, because ...

163 views

This is a typical use case for a paired t-test. The idea is to consider only the runtime difference $\Delta t$ for each problem and test for the null hypothesis $E(\Delta t)=0$. For a step-by-step ...

202 views

This is the classic contour tracking problem, which is usually sovled with an algorithm by Pavlidis described in Pavlidis: Algorithms for Grapics and Image Processing. pp. 129-165, Springer, 1982 ...

67 views

Instead of hard coding all cases with a switch clause, you can parametrize the function by its poles: double residue(size_t i, const std::vector<double> &poles) { double res = 1.0; for (...

59 views
For the pendulum, the following equations hold: $$\sin\varphi = \frac{x-x_0}{l}\quad\mbox{and}\quad \cos\varphi=\frac{l-(y-y_0)}{l}$$ where $l$ is the pendulum length, $\varphi$ is the angle of the ...
As your problem is a local regression problem, I would not use a spline fit, but LO(W)ESS. This estimates $f(x)$ at a sample point $x$ by a weighted least squares fit to the points $x_i$ that are the $... View answer 1 answers 7 votes 149 views Accepted answer 1 votes Please have a look at the answers to this question on CrossValidated. There you can find a worked out solution (including R-code) based on Gauss-Hermite quadrature, which is especially designed for ... View answer 1 answers 6 votes 391 views Accepted answer 1 votes I guess that you are not actually interested in the variance, but in a confidence interval for your observable$\theta$. It should be noted that computing the confidence interval from the variance (i.... View answer 2 answers 5 votes 2k views 1 votes When the points belong to more than one curve, it will first be necessary to cluster them into curves. A possible approach is described together with a reference implementation in Dalitz, Wilberg, ... View answer 2 answers 2 votes 150 views 0 votes According to Theorem 4.7 in the 2016 Continued Fractions course notes by Gautam Gopal Krishnan, a continued fraction$a_0 + \frac{1}{a_1+}\frac{1}{a_2+}\ldots$can be rewritten as a series:$$a_0 + \... View answer 3 answers 2 votes 284 views 0 votes Like rchilton1980, I would suggest the Hough transform. In your case, d does not to be quantized because it is known to be zero. When quantizing the two angles, beware that the naive quantization ($\...