Sponsored Content
Top Forums Programming Xlib - Rotation and interpolation of pixmap - Performance problems Post 302909119 by migurus on Monday 14th of July 2014 03:11:34 PM
Old 07-14-2014
Aside from algorithmic changes (and those usually result in the best speeding up) I see that sine and cosine functions are called repetitively, so I'd call them once and store result in a local double variable, then use those variables in your formulas, like so:
Code:
 
 cos_var = cos((double)deg/CONST);
 sin_var = sin((double)deg/CONST);
 true_x = true_x = (double)xx * cos_var + (double)yy * sin_var;
 etc...

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

variable interpolation

I've become obsessed with trying to get this to work. As of yet, I am unable to figure it out. Unfortunately, I don't have Linux or UNIX available when I get home. Anyone have tips for me on how I can pass param1 to ID via use of COUNTER and loop? thx. LIMIT=6 param1="999999999" export... (0 Replies)
Discussion started by: egkumpe
0 Replies

2. Programming

problems with drawing in x using xlib

Hi all, I'm currently learning xlib and I've encountered a bizarre mistake: function calls such as XDrawPoint, XDrawLine, etc., don't seem to work; a blank window with nothing in is appears. I believe this has something to do with the window manager I use, fluxbox. After checking the code and... (0 Replies)
Discussion started by: hydronium
0 Replies

3. AIX

Performance and paging problems

... a disk drive to be 100% busy? hdisk0 100.0 1.3K 342.7 1.3K 22.0 PgspIn 651 % Noncomp 75.5 hdisk1 100.0 1.3K 320.2 1.2K 20.0 PgspOut 6 % Client 75.5 It's really slowing down performance on my system and I would like to know what is causing this. ... (2 Replies)
Discussion started by: bbbngowc
2 Replies

4. SCO

CPU Performance Problems on VMWARE

hi We have migrated SCO 5.0.6 into ESX4, but the VM eats 100% of the virtual CPU. Here is top print from the SCO VM: last pid: 16773; load averages: 1.68, 1.25, 0.98 02:08:41 79 processes: 75 sleeping, 2 running, 1 zombie, 1 onproc CPU states: 0.0% idle, 17.0% user,... (7 Replies)
Discussion started by: ccc
7 Replies

5. AIX

AIX 5.3 performance problems

Hello, I encounter some performance issues on my AIX 5.3 server running in a LPAR on a P520. How do I investigate performance issues in AIX. Is there any kind of procedure that takes me to the steps to investigate my server and find the sub systems that is causing the issues? The performance... (1 Reply)
Discussion started by: petervg
1 Replies

6. Shell Programming and Scripting

Interpolation using awk

Hi all, Consider I have a text file containing: 1003 60 1005 80 1100 110 Based on that file I need to create another file which is containing value from 1001 till 1100 which is a linear interpolation between two point (for 1004; 1006;1007 until 1109) and extrapolation based on 2... (7 Replies)
Discussion started by: ardy_yana
7 Replies

7. Shell Programming and Scripting

Hi ! whether it is possible to do interpolation in scripting...

Hi ! Experts... I just wanted to know whether it is possible in scripting...to do interpolation.... if so....have a look on my data file I need temperature and salinity value with a bin size of 0.5 m output looks somewhat like this dep temp sal 0.5 25 0.077 1 25 ... (12 Replies)
Discussion started by: nex_asp
12 Replies

8. Shell Programming and Scripting

An interpolation between two files

Dear all, I always appreciate your help. I am an electrical engineer. I am using a tool for timing analysis of a circuit. I would like to interpolate results from two timing reports at different voltages (0.945V and 0.78V). If voltage is decreased, data arrival time is increased. For... (4 Replies)
Discussion started by: jypark22
4 Replies

9. What is on Your Mind?

MySQL Performance Problems

Just restarted MySQL a few times. There seems to be a problem with MySQL performance because one table (our man page table) is too large and I need to move that table to a new database and out of the main forums DB. That table is over 7 GB, bigger than the rest of the DB combined: ... (14 Replies)
Discussion started by: Neo
14 Replies
GRDSAMPLE(l)															      GRDSAMPLE(l)

NAME
grdsample - Resample a grd file onto a new grid SYNOPSIS
grdsample in_grdfile -Gout_grdfile [ -F ] [ -Idx[m|c][/dy[m|c]] ] [ -Lflag ] [ -Nnx/ny ] [ -Q ] [ -Rwest/east/south/north[r] ] [ -T ] [ -V ] DESCRIPTION
grdsample reads a grdfile and interpolates it to create a new grdfile with either: a different registration (-T); or, a new grid-spacing (-I) or number of nodes (-N), and perhaps also a new sub-region (-R). Interpolation is bicubic [Default] or bilinear (-Q) and uses boundary conditions (-L). Note that using (-R) only is equivalent to grdcut or grdedit -S. grdsample safely creates a fine mesh from a coarse one; the converse may suffer aliasing unless the data are filtered using grdfft or grdfilter. in_grdfile The name of the input 2-D binary grd file. -G The name of the output grd file. OPTIONS
No space between the option flag and the associated arguments. -F Force pixel registration. [Default is grid registration]. -I x_inc [and optionally y_inc] is the grid spacing. Append m to indicate minutes or c to indicate seconds. -L Boundary condition flag may be x or y or xy indicating data is periodic in range of x or y or both set by -R, or flag may be g indi- cating geographical conditions (x and y are lon and lat). [Default uses "natural" conditions (second partial derivative normal to edge is zero).] -N Specify number of columns nx and rows ny of new grid. -Q Quick mode, use bilinear rather than bicubic interpolation. -R west, east, south, and north specify the Region of interest. To specify boundaries in degrees and minutes [and seconds], use the dd:mm[:ss] format. Append r if lower left and upper right map coordinates are given instead of wesn. -T Translate between grid and pixel registration while keeping -R and -I the same; if input is grid-registered, output will be pixel- registered and vice-versa. The input file determines -R, -I and -N so no other options are necessary (except possibly -L or -Q). -V Selects verbose mode, which will send progress reports to stderr [Default runs "silently"]. HINTS
If an interpolation point is not on a node of the input grid, then a NaN at any node in the neighborhood surrounding the point will yield an interpolated NaN. Bicubic interpolation [default] yields continuous first derivatives but requires a neighborhood of 4 nodes by 4 nodes. Bilinear interpolation [-Q] uses only a 2 by 2 neighborhood, but yields only zeroth-order continuity. Use bicubic when smoothness is impor- tant. Use bilinear to minimize the propagation of NaNs. EXAMPLES
To resample the 5 x 5 minute grid in hawaii_5by5_topo.grd onto a 1 minute grid, try grdsample hawaii_5by5_topo.grd -I1m -Ghawaii_1by1_topo.grd To translate the gridline-registered file surface.grd to pixel registration, try grdsample surface.grd -T -Gpixel.grd SEE ALSO
gmt(1gmt), grdedit(1gmt), grdfft(1gmt), grdfilter(1gmt) 1 Jan 2004 GRDSAMPLE(l)
All times are GMT -4. The time now is 07:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy