import source from 1.3.40
[external/swig.git] / Examples / php / value / runme.php
1 <?php
2
3         require "example.php";
4
5
6         $v = new_vector();
7         vector_x_set($v,1.0);
8         vector_y_set($v,2.0);
9         vector_z_set($v,3.0);
10
11         $w = new_vector();
12         vector_x_set($w,10.0);
13         vector_y_set($w,11.0);
14         vector_z_set($w,12.0);
15
16         echo "I just created the following vector\n";
17         vector_print($v);
18         vector_print($w);
19
20         echo "\nNow I'm going to compute the dot product\n";
21
22         $d = dot_product($v, $w);
23
24         echo "dot product = $d (should be 68)\n";
25
26         echo "\nNow I'm going to add the vectors together\n";
27
28         $r = new_vector();
29         vector_add($v, $w, $r);
30
31         vector_print($r);
32
33         echo "The value should be (11,13,15)\n";
34
35         echo "\nNow I'm going to clean up the return result\n";
36
37 #       free($r);
38
39         echo "Good\n";
40
41 ?>
42
43