56 {
57 $points = 5;
58 $precision = 2;
59
61 $meter->initFormArray([
62 'unit_id' => 1,
63 'category' => 1,
64 'sequence' => 1,
65 'unit' => 'Meter',
66 'factor' => 1,
67 'baseunit_fi' => -1,
68 'baseunit_title' => ''
69 ]);
70
72 $centimeter->initFormArray([
73 'unit_id' => 2,
74 'category' => 1,
75 'sequence' => 2,
76 'unit' => 'Centimeter',
77 'factor' => 0.01,
78 'baseunit_fi' => 1,
79 'baseunit_title' => 'Meter'
80 ]);
81
83 $newtonmetre->initFormArray([
84 'unit_id' => 3,
85 'category' => 1,
86 'sequence' => 3,
87 'unit' => 'Newton Metre',
88 'factor' => 1,
89 'baseunit_fi' => -1,
90 'baseunit_title' => ''
91 ]);
92
94 $newtoncentimeter->initFormArray([
95 'unit_id' => 4,
96 'category' => 1,
97 'sequence' => 4,
98 'unit' => 'Newton Centimeter',
99 'factor' => 0.01,
100 'baseunit_fi' => 3,
101 'baseunit_title' => 'Newton Metre'
102 ]);
103
106 $v1->setValue(19.6);
107 $v1->setIntprecision(1);
108 $v2->setValue(6.6);
109 $v2->setIntprecision(1);
110
111 $v3 = clone $v1;
112 $v4 = clone $v2;
113 $v3->setUnit(null);
114 $v3->setVariable('$v3');
115 $v4->setUnit(null);
116 $v4->setVariable('$v4');
117
119 '$r1',
120 0,
121 0,
122 0,
123 $newtoncentimeter,
124 '$v1 * $v2',
125 $points,
126 $precision,
127 true,
128 33,
129 34,
130 33,
132 );
134 '$r2',
135 0,
136 0,
137 0,
138 $newtonmetre,
139 '$v1 * $v2',
140 $points,
141 $precision,
142 true,
143 33,
144 34,
145 33,
147 );
149 '$r3',
150 0,
151 0,
152 0,
153 null,
154 '$v1 * $v2',
155 $points,
156 $precision,
157 true,
158 33,
159 34,
160 33,
162 );
164 '$r4',
165 0,
166 0,
167 0,
168 null,
169 '$v1 * $v2',
170 $points,
171 $precision,
172 true,
173 33,
174 34,
175 33,
177 );
179 '$r5',
180 0,
181 0,
182 0,
183 null,
184 '$v1 * $v2',
185 $points,
186 $precision,
187 true,
188 33,
189 34,
190 33,
192 );
194 '$r6',
195 0,
196 0,
197 0,
198 null,
199 '$v3 * $v4',
200 $points,
201 $precision,
202 true,
203 33,
204 34,
205 33,
207 );
208
209
212 $v5->setValue(1);
213 $v6->setValue(3);
214
217 $v7->setValue(2);
218 $v8->setValue(4);
219
221 '$r7',
222 0,
223 0,
224 0,
225 null,
226 '$v5/$v6',
227 $points,
228 $precision,
229 true,
230 33,
231 34,
232 33,
234 );
235
237 '$r8',
238 0,
239 0,
240 0,
241 null,
242 '$v7/$v8',
243 $points,
244 $precision,
245 true,
246 33,
247 34,
248 33,
250 );
251
252
253 $v9 = clone $v7;
254 $v9->setVariable('$v9');
255 $v10 = clone $v8;
256 $v10->setVariable('$v10');
257
258 $v11 = clone $v7;
259 $v11->setVariable('$v11');
260 $v12 = clone $v8;
261 $v12->setVariable('$v12');
262
264 '$r9',
265 0,
266 0,
267 0,
268 null,
269 '$v9/$v10',
270 $points,
271 $precision,
272 true,
273 33,
274 34,
275 33,
277 );
278
280 '$r10',
281 0,
282 0,
283 0,
284 null,
285 '$v11/$v12',
286 $points,
287 $precision,
288 true,
289 33,
290 34,
291 33,
293 );
294
295
298 $v13->setValue(1);
299 $v14->setValue(3);
301 '$r11',
302 0,
303 0,
304 0,
305 null,
306 '$v13/$v14',
307 $points,
308 $precision,
309 true,
310 33,
311 34,
312 33,
314 );
315
319 $v15->setIntprecision(25);
320 $v16->setIntprecision(5);
321 $v17->setIntprecision(1);
322 $v15->setValue(225);
323 $v16->setValue(85);
324 $v17->setValue(10);
326 '$r12',
327 0,
328 0,
329 0,
330 null,
331 '1/(2*pi)*sqrt($v16*1000/$v15)+$v17-$v17',
332 $points,
333 1,
334 true,
335 33,
336 34,
337 33,
339 );
340
341 $variables = [
342 $v1->getVariable() => $v1,
343 $v2->getVariable() => $v2,
344 $v3->getVariable() => $v3,
345 $v4->getVariable() => $v4,
346 $v5->getVariable() => $v5,
347 $v6->getVariable() => $v6,
348 $v7->getVariable() => $v7,
349 $v8->getVariable() => $v8,
350 $v9->getVariable() => $v9,
351 $v10->getVariable() => $v10,
352 $v11->getVariable() => $v11,
353 $v12->getVariable() => $v12,
354 $v13->getVariable() => $v13,
355 $v14->getVariable() => $v14,
356 $v15->getVariable() => $v15,
357 $v16->getVariable() => $v16,
358 $v17->getVariable() => $v17,
359 ];
360
362 $r1->getResult() => $r1,
363 $r2->getResult() => $r2,
364 $r3->getResult() => $r3,
365 $r4->getResult() => $r4,
366 $r5->getResult() => $r5,
367 $r6->getResult() => $r6,
368 $r7->getResult() => $r7,
369 $r8->getResult() => $r8,
370 $r9->getResult() => $r9,
371 $r10->getResult() => $r10,
372 $r11->getResult() => $r11,
373 $r12->getResult() => $r12,
374 ];
375
376 return [
377
378 [$r1, $variables,
$results,
'129.36', $newtoncentimeter,
true],
379 [$r2, $variables,
$results,
'1.29', $newtonmetre,
true],
380 [$r3, $variables,
$results,
'1.29', $newtonmetre,
true],
381 [$r4, $variables,
$results,
'129.36', $newtoncentimeter,
true],
382 [$r5, $variables,
$results,
'1.29',
null,
true],
383 [$r6, $variables,
$results,
'129.36',
null,
true],
384
385 [$r7, $variables,
$results,
'1/3',
null,
true],
386 [$r8, $variables,
$results,
'4/8',
null,
true],
387
388 [$r9, $variables,
$results,
'1/2',
null,
true],
389 [$r10, $variables,
$results,
'4/8',
null,
false],
390
391 [$r11, $variables,
$results,
'1/3',
null,
true],
392
393 [$r12, $variables,
$results,
'3.1',
null,
true],
394 ];
395 }