File: Coordinate_Conversions.rb

package info (click to toggle)
libtioga-ruby 1.11-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 10,460 kB
  • ctags: 3,986
  • sloc: ansic: 38,451; ruby: 16,774; sh: 172; makefile: 111
file content (194 lines) | stat: -rw-r--r-- 6,204 bytes parent folder | download | duplicates (4)
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
#  Coordinate_Conversions.rb

module Tioga

=begin rdoc

There are four different coordinate systems used in Tioga.  The contents of the figure or plot
are positioned using "figure" coordinates which correspond to the values along the x and y axes
as determined by the boundary attributes.  Things like the title and axis labels are positioned using
"frame" coordinates that run from (0, 0) at the lower left corner of the frame to (1, 1) at the upper right
corner.  The frame is positioned on the page using "page" coordinates that run from (0, 0)
at the lower left of the page to (1, 1) at the upper right.  The actual numbers used in PDF and TeX files
are given in "output" coordinates which are a tenth of a point (i.e., 720 in output coords equals 1 inch).

The coordinate systems are naturally related in the following manner:

    figure <-> frame <-> page <-> output
    
There are conversion routines between each adjacent pair in this chain.  There are separate
routines for locations (x and y) and for distances (dx and dy).  And finally, the chain is closed
by conversion routines between figure and output coordinates.

=end

module Coordinate_Conversions
# Convert the position _x_ measured in page x coordinates to the 
# position in output x coordinates.
    def convert_page_to_output_x(x)
    end
    
# Convert the position _y_ measured in page y coordinates to the 
# position in output y coordinates.
    def convert_page_to_output_y(y)
    end

# Convert the distance _dx_ measured in page x coordinates to the 
# distance in output x coordinates.
    def convert_page_to_output_dx(dx)
    end

# Convert the distance _dy_ measured in page y coordinates to the 
# distance in output y coordinates.
    def convert_page_to_output_dy(dy)
    end

# Convert the position _x_ measured in output x coordinates to the 
# position in page x coordinates.
    def convert_output_to_page_x(x)
    end

# Convert the position _y_ measured in output y coordinates to the 
# position in page y coordinates.
    def convert_output_to_page_y(y)
    end

# Convert the distance _dx_ measured in output x coordinates to the 
# distance in page x coordinates.
    def convert_output_to_page_dx(dx)
    end

# Convert the distance _dy_ measured in output y coordinates to the same
# distance in page y coordinates.
    def convert_output_to_page_dy(dy)
    end

# Convert the position _x_ measured in page x coordinates to the 
# position in frame x coordinates.
    def convert_page_to_frame_x(x)
    end

# Convert the position _y_ measured in page y coordinates to the 
# position in frame y coordinates.
    def convert_page_to_frame_y(y)
    end

# Convert the distance _dx_ measured in page x coordinates to the 
# distance in frame x coordinates.
    def convert_page_to_frame_dx(dx)
    end

# Convert the distance _dy_ measured in page y coordinates to the 
# distance in frame y coordinates.
    def convert_page_to_frame_dy(dy)
    end

# Convert the position _x_ measured in frame x coordinates to the 
# position in page x coordinates.
    def convert_frame_to_page_x(x)
    end

# Convert the position _y_ measured in frame y coordinates to the 
# position in page y coordinates.
    def convert_frame_to_page_y(y)
    end

# Convert the distance _dx_ measured in frame x coordinates to the 
# distance in page x coordinates.
    def convert_frame_to_page_dx(dx)
    end

# Convert the distance _dy_ measured in frame y coordinates to the 
# distance in page y coordinates.
    def convert_frame_to_page_dy(dy)
    end

# Convert the position _x_ measured in figure x coordinates to the 
# position in frame x coordinates.
    def convert_figure_to_frame_x(x)
    end

# Convert the position _y_ measured in figure y coordinates to the 
# position in frame y coordinates.
    def convert_figure_to_frame_y(y)
    end

# Convert the distance _dx_ measured in figure x coordinates to the 
# distance in frame x coordinates.
    def convert_figure_to_frame_dx(dx)
    end

# Convert the distance _dy_ measured in figure y coordinates to the 
# distance in frame y coordinates.
    def convert_figure_to_frame_dy(dy)
    end

# Convert the position _x_ measured in frame x coordinates to the 
# position in figure x coordinates.
    def convert_frame_to_figure_x(x)
    end

# Convert the position _y_ measured in frame y coordinates to the 
# position in figure y coordinates.
    def convert_frame_to_figure_y(y)
    end

# Convert the distance _dx_ measured in frame x coordinates to the 
# distance in figure x coordinates.
    def convert_frame_to_figure_dx(dx)
    end

# Convert the distance _dy_ measured in frame y coordinates to the 
# distance in figure y coordinates.
    def convert_frame_to_figure_dy(dy)
    end

# Convert the position _x_ measured in figure x coordinates to the 
# position in output x coordinates.
    def convert_figure_to_output_x(x)
    end

# Convert the position _y_ measured in figure y coordinates to the 
# position in output y coordinates.
    def convert_figure_to_output_y(y) 
    end

# Convert the distance _dx_ measured in figure x coordinates to the 
# distance in output x coordinates.
    def convert_figure_to_output_dx(dx)
    end

# Convert the distance _dy_ measured in figure y coordinates to the 
# distance in output y coordinates.
    def convert_figure_to_output_dy(dy)
    end

# Convert the position _x_ measured in output x coordinates to the 
# position in figure x coordinates.
    def convert_output_to_figure_x(x)
    end

# Convert the position _y_ measured in output y coordinates to the 
# position in figure y coordinates.
    def convert_output_to_figure_y(y)
    end

# Convert the distance _dx_ measured in output x coordinates to the 
# distance in figure x coordinates.
    def convert_output_to_figure_dx(dx)
    end

# Convert the distance _dy_ measured in output y coordinates to the 
# distance in figure y coordinates.
    def convert_output_to_figure_dy(dy)
    end

# Returns the angle measured in degrees clockwise from the horizontal for the
# slope specified by _dx_ and _dy_ given in figure coordinates.
    def convert_to_degrees(dx, dy)
    end


end # module CoordinateConversions

end # module Tioga