manpagez: man pages & more
info mathgl
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.7 Functions on direction

These functions change the data in some direction like differentiations, integrations and so on. The direction in which the change will applied is specified by the string parameter, which may contain ‘x’, ‘y’ or ‘z’ characters for 1-st, 2-nd and 3-d dimension correspondengly.

Method on mglData: void CumSum (const char *dir)

Cumulative summation of the data in given direction or directions.

Method on mglData: void Integral (const char *dir)

Integrates (like cumulative summation) the data in given direction or directions.

Method on mglData: void Diff (const char *dir)

Differentiates the data in given direction or directions.

Method on mglData: void Diff (const mglData &x, const mglData &y)
Method on mglData: void Diff (const mglData &x, const mglData &y, const mglData &z)

Differentiates the data specified parametrically in direction x with y, z=constant. Parametrical differentiation uses the formula (for 2D case): da/dx = (a_j*y_i-a_i*y_j)/(x_j*y_i-x_i*y_j) where a_i=da/di, a_j=da/dj denotes usual differentiation along 1st and 2nd dimensions. The similar formula is used for 3D case. Note, that you may change the order of arguments – for example, if you have 2D data a(i,j) which depend on coordinates {x(i,j), y(i,j)} then usual derivative along ‘x’ will be Diff(x,y); and usual derivative along ‘y’ will be Diff(y,x);.

Method on mglData: void Diff2 (const char *dir)

Double-differentiates (like Laplace operator) the data in given direction.

Method on mglData: void Swap (const char *dir)

Swaps the left and right part of the data in given direction (useful for Fourier spectrum).

Method on mglData: void Mirror (const char *dir)

Mirror the left-to-right part of the data in given direction. Looks like change the value index i->n-i.

Method on mglData: void Sew (const char *dir, float da=2*M_PI)

Remove value steps (like phase jumps after inverse trigonometric functions) with period da in given direction.

Method on mglData: void Smooth (int Type, const char *dir, float delta=0)

Smooths the data on specified direction or directions by method Type. Now 4 methods are supported: SMOOTH_NONE does nothing for delta=0 or approaches data to zero with the step delta, SMOOTH_LINE_3 linear averaging by 3 points, SMOOTH_LINE_5 linear averaging by 5 points, SMOOTH_QUAD_5 quadratic averaging by 5 points. Parameter delta forbids to change values of array more than delta from the original ones. String dirs specifies the dimensions which will be smoothed. It may contain characters: 'x' for 1st dimension, 'y' for 2nd dimension, 'z' for 3d dimension.

Method on mglData: void Smooth (const char *dir)

Smooths the data on specified direction(s). This is the same as Smooth() but argument Type is specified in string as ‘0’ for SMOOTH_NONE, ‘3’ for SMOOTH_LINE_3, ‘5’ for SMOOTH_LINE_5. If string dir don't contain digits ‘035’ then Type=SMOOTH_QUAD_5 is used.

Method on mglData: void Envelop (char dir='x')

Find envelop for data values along direction dir.

Method on mglData: void NormSl (float v1=0, float v2=1, char dir='z', bool keep_en=true, bool sym=false)

Normalizes data slice-by-slice along direction dir the data in slices to range [v1,v2]. If flag sym=true then symmetrical interval [-max(|v1|,|v2|), max(|v1|,|v2|)] is used. If keep_en is set then maximal value of k-th slice will be limited by \sqrt{\sum a_ij(k)/\sum a_ij(0)}.

Method on mglData: void Norm (float v1=0, float v2=1, bool sym=false, int dim=0)

Normalizes the data to range [v1,v2]. If flag sym=true then symmetrical interval [-max(|v1|,|v2|), max(|v1|,|v2|)] is used. Modification will be applied only for slices >=dim.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]
© manpagez.com 2000-2026
Individual documents may contain additional copyright information.