1 | |
---|
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
---|
3 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
4 | |
---|
5 | <!-- Generated by IDLdoc 2.0 --> |
---|
6 | |
---|
7 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
---|
8 | <head> |
---|
9 | <title>definetri.pro (SAXO Documentation)</title> |
---|
10 | |
---|
11 | |
---|
12 | <link rel="stylesheet" type="text/css" media="all" href="./../../main_files.css" /> |
---|
13 | <link rel="stylesheet" type="text/css" media="print" href="./../../main_files_print.css" /> |
---|
14 | |
---|
15 | |
---|
16 | <script type="text/javascript"> |
---|
17 | function setTitle() { |
---|
18 | parent.document.title="definetri.pro (SAXO Documentation)"; |
---|
19 | } |
---|
20 | </script> |
---|
21 | </head> |
---|
22 | |
---|
23 | <body onload="setTitle();"> |
---|
24 | |
---|
25 | <div id="navbar_title"> |
---|
26 | <h1>SAXO Documentation</h1> |
---|
27 | </div> |
---|
28 | |
---|
29 | |
---|
30 | <div id="main_navbar"> |
---|
31 | |
---|
32 | <table cellspacing="0"> |
---|
33 | <tr> |
---|
34 | |
---|
35 | <td><a href="./../../overview.html" title="Overview of library">Overview</a></td> |
---|
36 | |
---|
37 | |
---|
38 | |
---|
39 | <td >Directory</td> |
---|
40 | |
---|
41 | |
---|
42 | |
---|
43 | <td><a href="./../../idldoc-categories.html" title="Browse library by category">Categories</a></td> |
---|
44 | |
---|
45 | |
---|
46 | |
---|
47 | <td><a href="./../../idldoc-index.html" title="Index of files, routines, and parameters">Index</a></td> |
---|
48 | |
---|
49 | |
---|
50 | |
---|
51 | <td><a href="./../../search-page.html" title="Search library">Search</a></td> |
---|
52 | |
---|
53 | |
---|
54 | <td id="selected">File</td> |
---|
55 | |
---|
56 | |
---|
57 | <td><a href="../../../../ToBeReviewed/TRIANGULATION//definetri.pro" title="Source code of a file">Source</a></td> |
---|
58 | |
---|
59 | |
---|
60 | |
---|
61 | <td><a href="./../../idldoc-help.html" title="Help on IDLdoc">Help</a></td> |
---|
62 | |
---|
63 | |
---|
64 | <td >Etc</td> |
---|
65 | |
---|
66 | <td id="flexible">Developer documentation</td> |
---|
67 | </tr> |
---|
68 | </table> |
---|
69 | |
---|
70 | </div> |
---|
71 | |
---|
72 | <div id="secondary_navbar"> |
---|
73 | |
---|
74 | <a href="completecointerre.html"><<prev file</a> | <a href="definetri_e.html">next file >></a> <a href="definetri.html" target="_TOP">view single page</a> | <a href="./../../index.html" target="_TOP">view frames</a> summary: fields | routine details: <a href="#routine_details">routine</a> |
---|
75 | |
---|
76 | </div> |
---|
77 | |
---|
78 | |
---|
79 | <div id="container"> |
---|
80 | |
---|
81 | <h1 class="directory"><a href="directory-overview.html">ToBeReviewed/TRIANGULATION/</a></h1> |
---|
82 | <h2 class="pro_file">definetri.pro</h2> |
---|
83 | |
---|
84 | <div id="file_attr"> |
---|
85 | <dl> |
---|
86 | </dl> |
---|
87 | </div> |
---|
88 | |
---|
89 | <div id="file_comments"> |
---|
90 | Define a triangulation array like <a href="/Applications/itt/idl64/help/online_help/TRIANGULATE.html">TRIANGULATE</a>. |
---|
91 | |
---|
92 | But in a VERY SIMPLE CASE: |
---|
93 | the points are regularly-gridded on nx*ny array. |
---|
94 | Find a Delaunay triangulation for this set of points is easy: |
---|
95 | Points define (nx-1)*(ny-1) rectangles which we can cut in 2 triangles. |
---|
96 | |
---|
97 | cf. figure above |
---|
98 | |
---|
99 | <pre> |
---|
100 | ny-1*---*---*. . . . . .*---*---* |
---|
101 | | +| +| | +| +| |
---|
102 | | + | + | | + | + | |
---|
103 | |+ |+ | |+ |+ | |
---|
104 | ny-2*---*---*. . . . . .*---*---* |
---|
105 | . . . . |
---|
106 | . . . . |
---|
107 | . . . . |
---|
108 | 1*---*---*. . . . . .*---*---* |
---|
109 | | +| +| | +| +| |
---|
110 | | + | + | | + | + | |
---|
111 | |+ |+ | |+ |+ | |
---|
112 | 0*---*---*. . . . . .*---*---* |
---|
113 | 0 1 2 nx-3 nx-2 nx-1 |
---|
114 | </pre> |
---|
115 | |
---|
116 | You have 2 ways to cut a rectangle: |
---|
117 | 1) the upward diagonal 2) the downward diagonal |
---|
118 | |
---|
119 | <pre> |
---|
120 | *---* *---* |
---|
121 | | +| |+ | |
---|
122 | | + | | + | |
---|
123 | |+ | | +| |
---|
124 | *---* *---* |
---|
125 | </pre> |
---|
126 | </div> |
---|
127 | |
---|
128 | |
---|
129 | |
---|
130 | |
---|
131 | |
---|
132 | |
---|
133 | |
---|
134 | |
---|
135 | |
---|
136 | <div id="routine_details"> |
---|
137 | |
---|
138 | |
---|
139 | <div class="routine_details" id="_definetri"> |
---|
140 | |
---|
141 | <h2><a class="top" href="#container">top</a>definetri <span class="categories"> |
---|
142 | Utilities |
---|
143 | </span></h2> |
---|
144 | |
---|
145 | <p class="header"> |
---|
146 | <span class="result">result = </span>definetri(<span class="result"><a href="#_definetri_param_nx">nx</a>, <a href="#_definetri_param_ny">ny</a>[, <a href="#_definetri_param_downward">downward</a>]</span>)</p> |
---|
147 | |
---|
148 | <div class="comments"> |
---|
149 | </div> |
---|
150 | |
---|
151 | <h3>Return value</h3><div class="preformat"> |
---|
152 | triangles is a 2d array and its dimensions are 3 and 2*(nx-1)*(ny-1). |
---|
153 | triangles is defined like in the TRIANGULATE procedure. |
---|
154 | </div> |
---|
155 | |
---|
156 | |
---|
157 | <h3>Parameters</h3> |
---|
158 | |
---|
159 | |
---|
160 | <h4 id="_definetri_param_nx">nx |
---|
161 | <span class="attr">in</span> |
---|
162 | |
---|
163 | |
---|
164 | <span class="attr">required</span> |
---|
165 | |
---|
166 | |
---|
167 | |
---|
168 | |
---|
169 | </h4> |
---|
170 | |
---|
171 | <div class="comments"> |
---|
172 | The x dimension array |
---|
173 | </div> |
---|
174 | |
---|
175 | <h4 id="_definetri_param_ny">ny |
---|
176 | <span class="attr">in</span> |
---|
177 | |
---|
178 | |
---|
179 | <span class="attr">required</span> |
---|
180 | |
---|
181 | |
---|
182 | |
---|
183 | |
---|
184 | </h4> |
---|
185 | |
---|
186 | <div class="comments"> |
---|
187 | The y dimension array |
---|
188 | </div> |
---|
189 | |
---|
190 | <h4 id="_definetri_param_downward">downward |
---|
191 | <span class="attr">in</span> |
---|
192 | |
---|
193 | <span class="attr">optional</span> |
---|
194 | |
---|
195 | |
---|
196 | |
---|
197 | |
---|
198 | |
---|
199 | </h4> |
---|
200 | |
---|
201 | <div class="comments"> |
---|
202 | When downward is undefined all rectangles are cut in using the upward |
---|
203 | diagonal. |
---|
204 | downward is a vector which contains the rectangles numbers which are cut in |
---|
205 | using the downward diagonal. |
---|
206 | The rectangle number is defined by the index (in a nx*ny vector) of the |
---|
207 | lower-left corner of the rectangle. |
---|
208 | </div> |
---|
209 | |
---|
210 | |
---|
211 | |
---|
212 | |
---|
213 | |
---|
214 | |
---|
215 | <h3>Examples</h3><div class="preformat"> |
---|
216 | |
---|
217 | IDL> triangles=definetri(3,3,[1,3]) |
---|
218 | |
---|
219 | triangles will be this kind of triangulation: |
---|
220 | |
---|
221 | <pre> |
---|
222 | *---*---* |
---|
223 | |+ | +| |
---|
224 | | + | + | |
---|
225 | | +|+ | |
---|
226 | *---*---* |
---|
227 | | +|+ | |
---|
228 | | + | + | |
---|
229 | |+ | +| |
---|
230 | *---*---* |
---|
231 | |
---|
232 | <pre> |
---|
233 | </div> |
---|
234 | <h3>Version history</h3> |
---|
235 | |
---|
236 | <h4>Version</h4><div class="preformat"> |
---|
237 | $Id: definetri.pro 325 2007-12-06 10:04:53Z pinsard $</div> |
---|
238 | <h4>History</h4><div class="preformat"> |
---|
239 | sebastien Masson (smlod@ipsl.jussieu.fr) |
---|
240 | 4/3/1999 |
---|
241 | </div> |
---|
242 | |
---|
243 | |
---|
244 | |
---|
245 | |
---|
246 | |
---|
247 | |
---|
248 | |
---|
249 | |
---|
250 | |
---|
251 | |
---|
252 | |
---|
253 | |
---|
254 | |
---|
255 | |
---|
256 | |
---|
257 | |
---|
258 | <h3>Statistics</h3> |
---|
259 | <table class="statistics"> |
---|
260 | <tr><td>McCabe cyclic</td><td> 6</td></tr> |
---|
261 | <tr><td>McCabe essential</td><td> 1</td></tr> |
---|
262 | <tr><td>McCabe modular design</td><td> 1</td></tr> |
---|
263 | </table> |
---|
264 | |
---|
265 | |
---|
266 | </div> |
---|
267 | |
---|
268 | </div> |
---|
269 | |
---|
270 | |
---|
271 | |
---|
272 | <div id="tagline">Produced by IDLdoc 2.0.</div> |
---|
273 | |
---|
274 | </div> |
---|
275 | |
---|
276 | </body> |
---|
277 | </html> |
---|