Module: Tioga::Coordinate_Conversions
- Defined in:
- lib/Tioga/Coordinate_Conversions.rb
Overview
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 by default tenth of a point (i.e., 720 in output coords equals 1 inch) (but you can redefined the scaling factor as the optional argument to FigureMaker.new).
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.
Instance Method Summary collapse
-
#convert_figure_to_frame_dx(dx) ⇒ Object
Convert the distance dx measured in figure x coordinates to the distance in frame x coordinates.
-
#convert_figure_to_frame_dy(dy) ⇒ Object
Convert the distance dy measured in figure y coordinates to the distance in frame y coordinates.
-
#convert_figure_to_frame_x(x) ⇒ Object
Convert the position x measured in figure x coordinates to the position in frame x coordinates.
-
#convert_figure_to_frame_y(y) ⇒ Object
Convert the position y measured in figure y coordinates to the position in frame y coordinates.
-
#convert_figure_to_output_dx(dx) ⇒ Object
Convert the distance dx measured in figure x coordinates to the distance in output x coordinates.
-
#convert_figure_to_output_dy(dy) ⇒ Object
Convert the distance dy measured in figure y coordinates to the distance in output y coordinates.
-
#convert_figure_to_output_x(x) ⇒ Object
Convert the position x measured in figure x coordinates to the position in output x coordinates.
-
#convert_figure_to_output_y(y) ⇒ Object
Convert the position y measured in figure y coordinates to the position in output y coordinates.
-
#convert_frame_to_figure_dx(dx) ⇒ Object
Convert the distance dx measured in frame x coordinates to the distance in figure x coordinates.
-
#convert_frame_to_figure_dy(dy) ⇒ Object
Convert the distance dy measured in frame y coordinates to the distance in figure y coordinates.
-
#convert_frame_to_figure_x(x) ⇒ Object
Convert the position x measured in frame x coordinates to the position in figure x coordinates.
-
#convert_frame_to_figure_y(y) ⇒ Object
Convert the position y measured in frame y coordinates to the position in figure y coordinates.
-
#convert_frame_to_page_dx(dx) ⇒ Object
Convert the distance dx measured in frame x coordinates to the distance in page x coordinates.
-
#convert_frame_to_page_dy(dy) ⇒ Object
Convert the distance dy measured in frame y coordinates to the distance in page y coordinates.
-
#convert_frame_to_page_x(x) ⇒ Object
Convert the position x measured in frame x coordinates to the position in page x coordinates.
-
#convert_frame_to_page_y(y) ⇒ Object
Convert the position y measured in frame y coordinates to the position in page y coordinates.
-
#convert_output_to_figure_dx(dx) ⇒ Object
Convert the distance dx measured in output x coordinates to the distance in figure x coordinates.
-
#convert_output_to_figure_dy(dy) ⇒ Object
Convert the distance dy measured in output y coordinates to the distance in figure y coordinates.
-
#convert_output_to_figure_x(x) ⇒ Object
Convert the position x measured in output x coordinates to the position in figure x coordinates.
-
#convert_output_to_figure_y(y) ⇒ Object
Convert the position y measured in output y coordinates to the position in figure y coordinates.
-
#convert_output_to_page_dx(dx) ⇒ Object
Convert the distance dx measured in output x coordinates to the distance in page x coordinates.
-
#convert_output_to_page_dy(dy) ⇒ Object
Convert the distance dy measured in output y coordinates to the same distance in page y coordinates.
-
#convert_output_to_page_x(x) ⇒ Object
Convert the position x measured in output x coordinates to the position in page x coordinates.
-
#convert_output_to_page_y(y) ⇒ Object
Convert the position y measured in output y coordinates to the position in page y coordinates.
-
#convert_page_to_frame_dx(dx) ⇒ Object
Convert the distance dx measured in page x coordinates to the distance in frame x coordinates.
-
#convert_page_to_frame_dy(dy) ⇒ Object
Convert the distance dy measured in page y coordinates to the distance in frame y coordinates.
-
#convert_page_to_frame_x(x) ⇒ Object
Convert the position x measured in page x coordinates to the position in frame x coordinates.
-
#convert_page_to_frame_y(y) ⇒ Object
Convert the position y measured in page y coordinates to the position in frame y coordinates.
-
#convert_page_to_output_dx(dx) ⇒ Object
Convert the distance dx measured in page x coordinates to the distance in output x coordinates.
-
#convert_page_to_output_dy(dy) ⇒ Object
Convert the distance dy measured in page y coordinates to the distance in output y coordinates.
-
#convert_page_to_output_x(x) ⇒ Object
Convert the position x measured in page x coordinates to the position in output x coordinates.
-
#convert_page_to_output_y(y) ⇒ Object
Convert the position y measured in page y coordinates to the position in output y coordinates.
-
#convert_to_degrees(dx, dy) ⇒ Object
Returns the angle measured in degrees clockwise from the horizontal for the slope specified by dx and dy given in figure coordinates.
-
#scaling_factor ⇒ Object
Returns the scaling factor from postscript points to output coordinates (10 by default).
Instance Method Details
#convert_figure_to_frame_dx(dx) ⇒ Object
Convert the distance dx measured in figure x coordinates to the distance in frame x coordinates.
124 125 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 124 def convert_figure_to_frame_dx(dx) end |
#convert_figure_to_frame_dy(dy) ⇒ Object
Convert the distance dy measured in figure y coordinates to the distance in frame y coordinates.
129 130 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 129 def convert_figure_to_frame_dy(dy) end |
#convert_figure_to_frame_x(x) ⇒ Object
Convert the position x measured in figure x coordinates to the position in frame x coordinates.
114 115 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 114 def convert_figure_to_frame_x(x) end |
#convert_figure_to_frame_y(y) ⇒ Object
Convert the position y measured in figure y coordinates to the position in frame y coordinates.
119 120 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 119 def convert_figure_to_frame_y(y) end |
#convert_figure_to_output_dx(dx) ⇒ Object
Convert the distance dx measured in figure x coordinates to the distance in output x coordinates.
164 165 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 164 def convert_figure_to_output_dx(dx) end |
#convert_figure_to_output_dy(dy) ⇒ Object
Convert the distance dy measured in figure y coordinates to the distance in output y coordinates.
169 170 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 169 def convert_figure_to_output_dy(dy) end |
#convert_figure_to_output_x(x) ⇒ Object
Convert the position x measured in figure x coordinates to the position in output x coordinates.
154 155 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 154 def convert_figure_to_output_x(x) end |
#convert_figure_to_output_y(y) ⇒ Object
Convert the position y measured in figure y coordinates to the position in output y coordinates.
159 160 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 159 def convert_figure_to_output_y(y) end |
#convert_frame_to_figure_dx(dx) ⇒ Object
Convert the distance dx measured in frame x coordinates to the distance in figure x coordinates.
144 145 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 144 def convert_frame_to_figure_dx(dx) end |
#convert_frame_to_figure_dy(dy) ⇒ Object
Convert the distance dy measured in frame y coordinates to the distance in figure y coordinates.
149 150 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 149 def convert_frame_to_figure_dy(dy) end |
#convert_frame_to_figure_x(x) ⇒ Object
Convert the position x measured in frame x coordinates to the position in figure x coordinates.
134 135 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 134 def convert_frame_to_figure_x(x) end |
#convert_frame_to_figure_y(y) ⇒ Object
Convert the position y measured in frame y coordinates to the position in figure y coordinates.
139 140 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 139 def convert_frame_to_figure_y(y) end |
#convert_frame_to_page_dx(dx) ⇒ Object
Convert the distance dx measured in frame x coordinates to the distance in page x coordinates.
104 105 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 104 def convert_frame_to_page_dx(dx) end |
#convert_frame_to_page_dy(dy) ⇒ Object
Convert the distance dy measured in frame y coordinates to the distance in page y coordinates.
109 110 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 109 def convert_frame_to_page_dy(dy) end |
#convert_frame_to_page_x(x) ⇒ Object
Convert the position x measured in frame x coordinates to the position in page x coordinates.
94 95 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 94 def convert_frame_to_page_x(x) end |
#convert_frame_to_page_y(y) ⇒ Object
Convert the position y measured in frame y coordinates to the position in page y coordinates.
99 100 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 99 def convert_frame_to_page_y(y) end |
#convert_output_to_figure_dx(dx) ⇒ Object
Convert the distance dx measured in output x coordinates to the distance in figure x coordinates.
184 185 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 184 def convert_output_to_figure_dx(dx) end |
#convert_output_to_figure_dy(dy) ⇒ Object
Convert the distance dy measured in output y coordinates to the distance in figure y coordinates.
189 190 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 189 def convert_output_to_figure_dy(dy) end |
#convert_output_to_figure_x(x) ⇒ Object
Convert the position x measured in output x coordinates to the position in figure x coordinates.
174 175 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 174 def convert_output_to_figure_x(x) end |
#convert_output_to_figure_y(y) ⇒ Object
Convert the position y measured in output y coordinates to the position in figure y coordinates.
179 180 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 179 def convert_output_to_figure_y(y) end |
#convert_output_to_page_dx(dx) ⇒ Object
Convert the distance dx measured in output x coordinates to the distance in page x coordinates.
64 65 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 64 def convert_output_to_page_dx(dx) end |
#convert_output_to_page_dy(dy) ⇒ Object
Convert the distance dy measured in output y coordinates to the same distance in page y coordinates.
69 70 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 69 def convert_output_to_page_dy(dy) end |
#convert_output_to_page_x(x) ⇒ Object
Convert the position x measured in output x coordinates to the position in page x coordinates.
54 55 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 54 def convert_output_to_page_x(x) end |
#convert_output_to_page_y(y) ⇒ Object
Convert the position y measured in output y coordinates to the position in page y coordinates.
59 60 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 59 def convert_output_to_page_y(y) end |
#convert_page_to_frame_dx(dx) ⇒ Object
Convert the distance dx measured in page x coordinates to the distance in frame x coordinates.
84 85 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 84 def convert_page_to_frame_dx(dx) end |
#convert_page_to_frame_dy(dy) ⇒ Object
Convert the distance dy measured in page y coordinates to the distance in frame y coordinates.
89 90 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 89 def convert_page_to_frame_dy(dy) end |
#convert_page_to_frame_x(x) ⇒ Object
Convert the position x measured in page x coordinates to the position in frame x coordinates.
74 75 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 74 def convert_page_to_frame_x(x) end |
#convert_page_to_frame_y(y) ⇒ Object
Convert the position y measured in page y coordinates to the position in frame y coordinates.
79 80 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 79 def convert_page_to_frame_y(y) end |
#convert_page_to_output_dx(dx) ⇒ Object
Convert the distance dx measured in page x coordinates to the distance in output x coordinates.
44 45 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 44 def convert_page_to_output_dx(dx) end |
#convert_page_to_output_dy(dy) ⇒ Object
Convert the distance dy measured in page y coordinates to the distance in output y coordinates.
49 50 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 49 def convert_page_to_output_dy(dy) end |
#convert_page_to_output_x(x) ⇒ Object
Convert the position x measured in page x coordinates to the position in output x coordinates.
34 35 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 34 def convert_page_to_output_x(x) end |
#convert_page_to_output_y(y) ⇒ Object
Convert the position y measured in page y coordinates to the position in output y coordinates.
39 40 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 39 def convert_page_to_output_y(y) end |
#convert_to_degrees(dx, dy) ⇒ Object
Returns the angle measured in degrees clockwise from the horizontal for the slope specified by dx and dy given in figure coordinates.
194 195 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 194 def convert_to_degrees(dx, dy) end |
#scaling_factor ⇒ Object
Returns the scaling factor from postscript points to output coordinates (10 by default)
29 30 |
# File 'lib/Tioga/Coordinate_Conversions.rb', line 29 def scaling_factor end |