5.3.2 Curved coordinates

MGL command: axis 'fx' 'fy' 'fz' ['fa'='']
Method on mglGraph: void SetFunc (const char *EqX, const char *EqY, const char *EqZ="", const char *EqA="")
C function: void mgl_set_func (HMGL gr, const char *EqX, const char *EqY, const char *EqZ, const char *EqA)

Sets transformation formulas for curvilinear coordinate. Each string should contain mathematical expression for real coordinate depending on internal coordinates ‘x’, ‘y’, ‘z’ and ‘a’ or ‘c’ for colorbar. For example, the cylindrical coordinates are introduced as SetFunc("x*cos(y)", "x*sin(y)", "z");. For removing of formulas the corresponding parameter should be empty or NULL. Using transformation formulas will slightly slowing the program. Parameter EqA set the similar transformation formula for color scheme. See Textual formulas.

MGL command: axis how
Method on mglGraph: void SetCoor (int how)
C function: void mgl_set_coor (HMGL gr, int how)

Sets one of the predefined transformation formulas for curvilinear coordinate. Parameter how define the coordinates:

mglCartesian=0

Cartesian coordinates (no transformation, {x,y,z});

mglPolar=1

Polar coordinates: {x*cos(y), x*sin(y), z};

mglSpherical=2

Sperical coordinates: {x*sin(y)*cos(z), x*sin(y)*sin(z), x*cos(y)};

mglParabolic=3

Parabolic coordinates: {x*y, (x*x-y*y)/2, z}

mglParaboloidal=4

Paraboloidal coordinates: {(x*x-y*y)*cos(z)/2, (x*x-y*y)*sin(z)/2, x*y};

mglOblate=5

Oblate coordinates: {cosh(x)*cos(y)*cos(z), cosh(x)*cos(y)*sin(z), sinh(x)*sin(y)};

mglProlate=6

Prolate coordinates: {sinh(x)*sin(y)*cos(z), sinh(x)*sin(y)*sin(z), cosh(x)*cos(y)};

mglElliptic=7

Elliptic coordinates: {cosh(x)*cos(y), sinh(x)*sin(y), z};

mglToroidal=8

Toroidal coordinates: {sinh(x)*cos(z)/(cosh(x)-cos(y)), sinh(x)*sin(z)/(cosh(x)-cos(y)), sin(y)/(cosh(x)-cos(y))};

mglBispherical=9

Bispherical coordinates: {sin(y)*cos(z)/(cosh(x)-cos(y)), sin(y)*sin(z)/(cosh(x)-cos(y)), sinh(x)/(cosh(x)-cos(y))};

mglBipolar=10

Bipolar coordinates: {sinh(x)/(cosh(x)-cos(y)), sin(y)/(cosh(x)-cos(y)), z};

mglLogLog=11

Log-log coordinates: {lg(x), lg(y), lg(z)};

mglLogX=12

Log-x coordinates: {lg(x), y, z};

mglLogY=13

Log-y coordinates: {x, lg(y), z}.

MGL command: ternary val
Method on mglGraph: void Ternary (int tern)
C function: void mgl_set_ternary (HMGL gr, int tern)

The function sets to draws Ternary (tern=1), Quaternary (tern=2) plot or projections (tern=4,5,6).

Ternary plot is special plot for 3 dependent coordinates (components) a, b, c so that a+b+c=1. MathGL uses only 2 independent coordinates a=x and b=y since it is enough to plot everything. At this third coordinate z act as another parameter to produce contour lines, surfaces and so on.

Correspondingly, Quaternary plot is plot for 4 dependent coordinates a, b, c and d so that a+b+c+d=1. MathGL uses only 3 independent coordinates a=x, b=y and d=z since it is enough to plot everything.

Projections can be obtained by adding value 4 to tern argument. So, that tern=4 will draw projections in Cartesian coordinates, tern=5 will draw projections in Ternary coordinates, tern=6 will draw projections in Quaternary coordinates. If you add 8 instead of 4 then all text labels will not be printed on projections.

Use Ternary(0) for returning to usual axis. See Ternary axis, for sample code and picture. See Axis projection, for sample code and picture.