<meta charset=UTF-8>
<script src="http://spelprogrammering.nu/simple.js">
function start()
{
  math.DDDPerspective = false;
  math.rotate3D(0.2,-0.1,0);
  math.axes3D();

  a     = {x: 1, y: 0, z: -3};
  b     = {x: 3, y: 2, z: -1};
  alpha = {x: 1, y: 0, z: -1};
  beta  = {x: 3, y: 0, z: -3};
  gamma = {x: 3, y: 0, z: -1};


  math.line3D(a.x, a.y, a.z,  gamma.x, gamma.y, gamma.z, "red");
  math.line3D(a.x, a.y, a.z,  alpha.x, alpha.y, alpha.z, "gray");
  math.line3D(gamma.x, gamma.y, gamma.z, alpha.x, alpha.y, alpha.z, "gray");
  math.line3D(b.x, b.y, b.z, gamma.x, gamma.y, gamma.z, "black");

  math.point3D(a.x, a.y, a.z, "green");
  math.text3D(a.x-0.35, -0.05, -3.5, "p1", "green");
  math.point3D(b.x, b.y, b.z, "red");
  math.text3D(b.x-0.65, 1.5, -3.5, "p2", "red");

  math.text3D(a.x-0.15, -0.4, -3.5, "d");
  math.text3D(a.x+0.4, -0.47, -3.5, "e");

  math.text3D(1.6, -0.20, -3.5, "a", "orange");

  math.text3D(-3, 2,   -3.5, "a² = d² + e²");
  math.text3D(-3, 1.5, -3.5, "d = p2.z-p1.z");
  math.text3D(-3, 1,   -3.5, "e = p2.x-p1.x");
}
</script>
        
Gå tillbaka