Exemple #1
0
</span><span class="s0">echo </span><span class="s2">&quot;&lt;hr&gt;&quot;</span><span class="s3">;</span><span class="s1">
m::toScene(
    m::planeH([</span><span class="s4">1</span><span class="s3">,</span><span class="s4">2</span><span class="s3">,</span><span class="s4">3</span><span class="s1">])
)</span><span class="s3">;</span><span class="s1">
print_r(r::doRendering())</span><span class="s3">;</span><span class="s1">
</span><span class="s0">echo </span><span class="s2">&quot;&lt;hr&gt;&quot;</span><span class="s3">;</span><span class="s1">
m::toScene(
    m::planeH([</span><span class="s4">1</span><span class="s3">,</span><span class="s4">2</span><span class="s3">,</span><span class="s4">3</span><span class="s1">]</span><span class="s3">,</span><span class="s1">[</span><span class="s4">9</span><span class="s3">,</span><span class="s4">8</span><span class="s3">,</span><span class="s4">7</span><span class="s1">]</span><span class="s3">,</span><span class="s2">&quot;f&quot;</span><span class="s1">)
)</span><span class="s3">;</span><span class="s1">
print_r(r::doRendering())</span><span class="s3">;</span><span class="s1">
</span><span class="s0">echo </span><span class="s2">&quot;&lt;hr&gt;&quot;</span><span class="s3">;</span>
    </pre>
</body>

</html>



<?php 
require_once "./../../mathPHP.include.php";
use math\math as m;
use math\internal\render as r;
m::toScene(m::planeH());
print_r(r::doRendering());
echo "<hr>";
m::toScene(m::planeH([1, 2, 3]));
print_r(r::doRendering());
echo "<hr>";
m::toScene(m::planeH([1, 2, 3], [9, 8, 7], "f"));
print_r(r::doRendering());
echo "<hr>";
 /**
  * renders a plane in hesse form
  *
  * @param object $obj mathPHP object
  * @return string html sourcecode
  */
 public static function renderhesse($obj)
 {
     $r = $obj->getSourceCode()["r"];
     if (!is_object($r)) {
         if (is_string($r)) {
             $obj->setSourceCode(render::doRendering([\math\math::vec($r)]), "r");
         } else {
             renderFunctions::paramterforeach($obj, function ($obj, $p, $index) {
                 renderFunctions::renderParameterObject($obj, $p, $index);
             }, function ($obj, $p, $index) {
                 renderFunctions::renderParameterCommon($obj, $p, $index);
             }, "r");
             renderFunctions::renderParameterVektor($obj);
         }
     } else {
         $obj->setSourceCode(render::doRendering([$r]), "r");
     }
     $a = $obj->getSourceCode()["a"];
     if (!is_object($a)) {
         if (is_string($a)) {
             $obj->setSourceCode(render::doRendering([\math\math::vec($a)]), "a");
         } else {
             renderFunctions::paramterforeach($obj, function ($obj, $p, $index) {
                 renderFunctions::renderParameterObject($obj, $p, $index);
             }, function ($obj, $p, $index) {
                 renderFunctions::renderParameterCommon($obj, $p, $index);
             }, "a");
             renderFunctions::renderParameterVektor($obj);
         }
     } else {
         $obj->setSourceCode(render::doRendering([$a]), "a");
     }
     $n = $obj->getSourceCode()["n"];
     if (!is_object($n)) {
         if (is_string($n)) {
             $obj->setSourceCode(render::doRendering([\math\math::vec($n)]), "n");
         } else {
             renderFunctions::paramterforeach($obj, function ($obj, $p, $index) {
                 renderFunctions::renderParameterObject($obj, $p, $index);
             }, function ($obj, $p, $index) {
                 renderFunctions::renderParameterCommon($obj, $p, $index);
             }, "n");
             renderFunctions::renderParameterVektor($obj);
         }
     } else {
         $obj->setSourceCode(render::doRendering([$n]), "n");
     }
     if (!is_array($obj->getContent()["r"]) && !is_array($obj->getContent()["a"])) {
         if (strlen($obj->getContent()["r"]) > 15 or strlen($obj->getContent()["a"]) > 15) {
             $round = true;
         } else {
             $round = false;
         }
     } else {
         $round = false;
     }
     return render::objectToSourececode([$obj->getSourceCode()["r"] . render::objectToSourececode("", "minus") . $obj->getSourceCode()["a"], !$round ? "[" : "(", !$round ? "]" : ")"], "klammern") . render::objectToSourececode("", "cdot") . $obj->getSourceCode()["n"] . render::objectToSourececode("", "eqq") . 0;
 }