Source for file vector_operations.php
Documentation is available at vector_operations.php
require_once "Math/Vector/Vector.php";
require_once "Math/Vector/Vector2.php";
require_once "Math/Vector/Vector3.php";
require_once "Math/Vector/VectorOp.php";
echo date("Y-m-d H:i:s"). "\n";
echo "==\nVector v1: ". $v1->toString (). "\n";
echo "Vector v2: ". $v2->toString (). "\n";
echo "v1 + v2: ". $r->toString (). "\n";
echo "v1 - v2: ". $r->toString (). "\n";
echo "v1 * v2: ". $r->toString (). "\n";
echo "v1 / v2: ". $r->toString (). "\n";
echo "==\nVector w1: ". $w1->toString (). "\n";
echo "Vector w2: ". $w2->toString (). "\n";
echo "Vector w3: ". $w3->toString (). "\n";
echo " 2.0 * w1 = ". $r->toString (). "\n";
echo "w2 x w3 = ". $r->toString (). "\n";
echo "The triple scalar product of 3 vectors is the volume
of the parallelepiped defined by the vectors. Three coplanar
vectors must give a volume of zero, w1, w2 and w3 are coplanar\n";
echo " w1 . (w2 x w3) = $r\n";
echo "Now we introduce z : ". $z->toString (). "\n";
echo "and z not being coplanar to w1, w2, or w3:\n";
echo " z * (w2 x w3) = $r\n";
echo " and the angle between z and w1 is $r radians\n";
echo "which is ". ($r * 180.0/M_PI ). " degrees\n";
Documentation generated on Mon, 11 Mar 2019 15:39:22 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|