summaryrefslogtreecommitdiff
path: root/doc/context/sources/general/manuals/luametafun/luametafun-surface.tex
blob: 427187f9508c3a2d7e334637ea6ca1c977c5c360 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
% language=us

\environment luametafun-style

\startcomponent luametafun-surface

\startchapter[title={Surface}]

This is work in progress so only some examples are shown here. Yet to be decided
is how we deal with axis and such.

In \in {figure} [surface:1] we see an example of a plot with axis as well as
lines drawn.

\startbuffer[1]
\startMPcode{doublefun}
    draw lmt_surface [
        preamble  = "local sin, cos = math.sin, math.cos",
        code      = "sin(x*x) - cos(y*y)"
        xmin      = -3,
        xmax      =  3,
        ymin      = -3,
        ymax      =  3,
        xvector   = { -0.3, -0.3 },
        height    = 5cm,
        axis      = { 40mm, 40mm, 30mm },
        clipaxis  = true,
        axiscolor = "gray",
    ] xsized .8TextWidth ;
\stopMPcode
\stopbuffer

\typebuffer[1]

\startplacefigure[reference=surface:1]
    \getbuffer[1]
\stopplacefigure

In \in {figure} [surface:2] we don't draw the axis and lines. We also use a high
resolution.

\startbuffer[2]
\startMPcode{doublefun}
    draw lmt_surface [
        preamble  = "local sin, cos = math.sin, math.cos",
        code      = "sin(x*x) - cos(y*y)"
        color     = "f, f/2, 1-f"
        color     = "f, f, 0"
        xstep     = .02,
        ystep     = .02,
        xvector   = { -0.4, -0.4 },
        height    = 5cm,
        lines     = false,
    ] xsized .8TextWidth ;
\stopMPcode
\stopbuffer

\typebuffer[2]

\startplacefigure[reference=surface:2]
    \getbuffer[2]
\stopplacefigure

The preliminary set of parameters is:

\starttabulate[|T|T|T|p|]
\FL
\BC name          \BC type    \BC default                \BC comment \NC \NR
\ML
\NC code          \NC string  \NC
\NC color         \NC string  \NC \type {"f, 0, 0"}      \NC \NC \NR
\NC linecolor     \NC numeric \NC \type {1}              \NC gray scale \NC \NR
\NC xmin          \NC numeric \NC \type {-1}             \NC \NC \NR
\NC xmax          \NC numeric \NC \type { 1}             \NC \NC \NR
\NC ymin          \NC numeric \NC \type {-1}             \NC \NC \NR
\NC ymax          \NC numeric \NC \type { 1}             \NC \NC \NR
\NC xstep         \NC numeric \NC \type {.1}             \NC \NC \NR
\NC ystep         \NC numeric \NC \type {.1}             \NC \NC \NR
\NC snap          \NC numeric \NC \type {.01}            \NC \NC \NR
\NC xvector       \NC list    \NC \type {{ -0.7, -0.7 }} \NC \NC \NR
\NC yvector       \NC list    \NC \type {{ 1, 0 }}       \NC \NC \NR
\NC zvector       \NC list    \NC \type {{ 0, 1 }}       \NC \NC \NR
\NC light         \NC list    \NC \type {{ 3, 3, 10 }}   \NC \NC \NR
\NC bright        \NC numeric \NC \type {100}            \NC \NC \NR
\NC clip          \NC boolean \NC \type {false}          \NC \NC \NR
\NC lines         \NC boolean \NC \type {true}           \NC \NC \NR
\NC axis          \NC list    \NC \type {{ }}            \NC \NC \NR
\NC clipaxis      \NC boolean \NC \type {false}          \NC \NC \NR
\NC axiscolor     \NC string  \NC \type {"gray"}         \NC \NC \NR
\NC axislinewidth \NC numeric \NC \type {1/2}            \NC \NC \NR
\LL
\stoptabulate

\startplacefigure[reference=contour:10]
    \startcombination[3*3]
        {\getbuffer[10a]} {\bf bitmap edge}
        {\getbuffer[10b]} {\bf bitmap cell}
        {\getbuffer[10c]} {\bf bitmap none}
        {\getbuffer[10d]} {\bf shape  shape}
        {\getbuffer[10e]} {\bf shape  edge}
        {\getbuffer[10f]} {\bf shape  none}
        {\getbuffer[10g]} {\bf band   edge}
        {\getbuffer[10h]} {\bf band   cell}
        {\getbuffer[10i]} {\bf band   none}
    \stopcombination
\stopplacefigure

\stopchapter

\stopcomponent