42 {
43 $points = 5;
44 $precision = 2;
45
47 $meter->initFormArray([
48 'unit_id' => 1,
49 'category' => 1,
50 'sequence' => 1,
51 'unit' => 'Meter',
52 'factor' => 1,
53 'baseunit_fi' => -1,
54 'baseunit_title' => ''
55 ]);
56
58 $centimeter->initFormArray([
59 'unit_id' => 2,
60 'category' => 1,
61 'sequence' => 2,
62 'unit' => 'Centimeter',
63 'factor' => 0.01,
64 'baseunit_fi' => 1,
65 'baseunit_title' => 'Meter'
66 ]);
67
69 $newtonmetre->initFormArray([
70 'unit_id' => 3,
71 'category' => 1,
72 'sequence' => 3,
73 'unit' => 'Newton Metre',
74 'factor' => 1,
75 'baseunit_fi' => -1,
76 'baseunit_title' => ''
77 ]);
78
80 $newtoncentimeter->initFormArray([
81 'unit_id' => 4,
82 'category' => 1,
83 'sequence' => 4,
84 'unit' => 'Newton Centimeter',
85 'factor' => 0.01,
86 'baseunit_fi' => 3,
87 'baseunit_title' => 'Newton Metre'
88 ]);
89
92 $v1->setValue(19.6);
93 $v1->setIntprecision(1);
94 $v2->setValue(6.6);
95 $v2->setIntprecision(1);
96
97 $v3 = clone $v1;
98 $v4 = clone $v2;
99 $v3->setUnit(null);
100 $v3->setVariable('$v3');
101 $v4->setUnit(null);
102 $v4->setVariable('$v4');
103
105 '$r1',
106 0,
107 0,
108 0,
109 $newtoncentimeter,
110 '$v1 * $v2',
111 $points,
112 $precision,
113 true,
114 33,
115 34,
116 33,
118 );
120 '$r2',
121 0,
122 0,
123 0,
124 $newtonmetre,
125 '$v1 * $v2',
126 $points,
127 $precision,
128 true,
129 33,
130 34,
131 33,
133 );
135 '$r3',
136 0,
137 0,
138 0,
139 null,
140 '$v1 * $v2',
141 $points,
142 $precision,
143 true,
144 33,
145 34,
146 33,
148 );
150 '$r4',
151 0,
152 0,
153 0,
154 null,
155 '$v1 * $v2',
156 $points,
157 $precision,
158 true,
159 33,
160 34,
161 33,
163 );
165 '$r5',
166 0,
167 0,
168 0,
169 null,
170 '$v1 * $v2',
171 $points,
172 $precision,
173 true,
174 33,
175 34,
176 33,
178 );
180 '$r6',
181 0,
182 0,
183 0,
184 null,
185 '$v3 * $v4',
186 $points,
187 $precision,
188 true,
189 33,
190 34,
191 33,
193 );
194
195
198 $v5->setValue(1);
199 $v6->setValue(3);
200
203 $v7->setValue(2);
204 $v8->setValue(4);
205
207 '$r7',
208 0,
209 0,
210 0,
211 null,
212 '$v5/$v6',
213 $points,
214 $precision,
215 true,
216 33,
217 34,
218 33,
220 );
221
223 '$r8',
224 0,
225 0,
226 0,
227 null,
228 '$v7/$v8',
229 $points,
230 $precision,
231 true,
232 33,
233 34,
234 33,
236 );
237
238
239 $v9 = clone $v7;
240 $v9->setVariable('$v9');
241 $v10 = clone $v8;
242 $v10->setVariable('$v10');
243
244 $v11 = clone $v7;
245 $v11->setVariable('$v11');
246 $v12 = clone $v8;
247 $v12->setVariable('$v12');
248
250 '$r9',
251 0,
252 0,
253 0,
254 null,
255 '$v9/$v10',
256 $points,
257 $precision,
258 true,
259 33,
260 34,
261 33,
263 );
264
266 '$r10',
267 0,
268 0,
269 0,
270 null,
271 '$v11/$v12',
272 $points,
273 $precision,
274 true,
275 33,
276 34,
277 33,
279 );
280
281
284 $v13->setValue(1);
285 $v14->setValue(3);
287 '$r11',
288 0,
289 0,
290 0,
291 null,
292 '$v13/$v14',
293 $points,
294 $precision,
295 true,
296 33,
297 34,
298 33,
300 );
301
305 $v15->setIntprecision(25);
306 $v16->setIntprecision(5);
307 $v17->setIntprecision(1);
308 $v15->setValue(225);
309 $v16->setValue(85);
310 $v17->setValue(10);
312 '$r12',
313 0,
314 0,
315 0,
316 null,
317 '1/(2*pi)*sqrt($v16*1000/$v15)+$v17-$v17',
318 $points,
319 1,
320 true,
321 33,
322 34,
323 33,
325 );
326
327 $variables = [
328 $v1->getVariable() => $v1,
329 $v2->getVariable() => $v2,
330 $v3->getVariable() => $v3,
331 $v4->getVariable() => $v4,
332 $v5->getVariable() => $v5,
333 $v6->getVariable() => $v6,
334 $v7->getVariable() => $v7,
335 $v8->getVariable() => $v8,
336 $v9->getVariable() => $v9,
337 $v10->getVariable() => $v10,
338 $v11->getVariable() => $v11,
339 $v12->getVariable() => $v12,
340 $v13->getVariable() => $v13,
341 $v14->getVariable() => $v14,
342 $v15->getVariable() => $v15,
343 $v16->getVariable() => $v16,
344 $v17->getVariable() => $v17,
345 ];
346
348 $r1->getResult() => $r1,
349 $r2->getResult() => $r2,
350 $r3->getResult() => $r3,
351 $r4->getResult() => $r4,
352 $r5->getResult() => $r5,
353 $r6->getResult() => $r6,
354 $r7->getResult() => $r7,
355 $r8->getResult() => $r8,
356 $r9->getResult() => $r9,
357 $r10->getResult() => $r10,
358 $r11->getResult() => $r11,
359 $r12->getResult() => $r12,
360 ];
361
362 return [
363
364 [$r1, $variables,
$results,
'129.36', $newtoncentimeter,
true],
365 [$r2, $variables,
$results,
'1.29', $newtonmetre,
true],
366 [$r3, $variables,
$results,
'1.29', $newtonmetre,
true],
367 [$r4, $variables,
$results,
'129.36', $newtoncentimeter,
true],
368 [$r5, $variables,
$results,
'1.29',
null,
true],
369 [$r6, $variables,
$results,
'129.36',
null,
true],
370
371 [$r7, $variables,
$results,
'1/3',
null,
true],
372 [$r8, $variables,
$results,
'4/8',
null,
true],
373
374 [$r9, $variables,
$results,
'1/2',
null,
true],
375 [$r10, $variables,
$results,
'4/8',
null,
false],
376
377 [$r11, $variables,
$results,
'1/3',
null,
true],
378
379 [$r12, $variables,
$results,
'3.0',
null,
true],
380 ];
381 }