interpolate

How do I interpolate variables to call a Perl function from a module?

Requirement is to pass module name and function name from the command-line argument. I need to get the command-line argument in the program and I need to call that function from that module For example, calling a try.pl program with 2 arguments: MODULE1(Module name) Display(Function name) perl try.pl MODULE1 Display I want to some t...

How to render a smooth path given a set of data points?

Hi, I've been puzzling over path rendering for the past couple of days without any real solution. By path rendering I mean given a set of x,y data points (at varying distance) to draw a dashed line (or in my case a rotated quad) of fixed length at regular intervals between the give data set points to create a smooth path. If you have ...

C Programming: Preprocessor, macros as tokens

Hi, I'm trying to do something that is conceptually similar to this, but can't seem to get it to work (error shown at end) any ideas? #include <stdio.h> int main( int argc , char const *argv[] ) { int abc_def_ghi = 42; #define SUFFIX ghi #define VAR(prefix) prefix##_def_##SUFFIX printf( "%d\n" , VAR(abc) ); return 0; } // un...

Finding the length of a cubic B-spline

Using scipy's interpolate.splprep function get a parametric spline on parameter u, but the domain of u is not the line integral of the spline, it is a piecewise linear connection of the input coordinates. I've tried integrate.splint, but that just gives the individual integrals over u. Obviously, I can numerically integrate a bunch of ...

numpy arange with multiple intervals

Hi, i have an numpy array which represents multiple x-intervals of a function: In [137]: x_foo Out[137]: array([211, 212, 213, 214, 215, 216, 217, 218, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950]) as you can see, in x_foo are two intervals: one from 211 to 218, and one from 940 to 950. these are intervals, which i w...