~ubuntu-branches/ubuntu/karmic/python-scipy/karmic

« back to all changes in this revision

Viewing changes to Lib/signal/bspline_util.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T. Chen (new)
  • Date: 2005-03-16 02:15:29 UTC
  • Revision ID: james.westby@ubuntu.com-20050316021529-xrjlowsejs0cijig
Tags: upstream-0.3.2
ImportĀ upstreamĀ versionĀ 0.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <math.h>
 
2
#include <stddef.h>
 
3
#include <stdlib.h>
 
4
#include <string.h>
 
5
#include <stdio.h>
 
6
 
 
7
void compute_root_from_lambda(double, double *, double *);
 
8
 
 
9
 
 
10
void
 
11
compute_root_from_lambda(lambda, r, omega)
 
12
     double lambda;
 
13
     double *r;
 
14
     double *omega;
 
15
{
 
16
    double xi;
 
17
    double tmp, tmp2;
 
18
 
 
19
    tmp = sqrt(3 + 144*lambda);
 
20
    xi = 1 - 96*lambda + 24*lambda * tmp;
 
21
    *omega = atan(sqrt((144*lambda - 1.0)/xi));
 
22
    tmp2 = sqrt(xi);
 
23
    *r = (24*lambda - 1 - tmp2)/(24*lambda) \
 
24
        * sqrt((48*lambda + 24*lambda*tmp))/tmp2;
 
25
    return;
 
26
}