protected function setUp() { parent::setUp(); $this->frameBuffer = $this->getMock(FrameBuffer::class); $this->frameBuffer->expects($this->any())->method('getHeight')->willReturn(self::TEST_HEIGHT); $this->frameBuffer->expects($this->any())->method('getWidth')->willReturn(self::TEST_WIDTH); $this->encoder = new JsonFrameEncoder($this->frameBuffer); }
function func($x, $y) { return 5 * cos(2 * sqrt($x * $x + $y * $y)) * exp(-0.3 * sqrt($x * $x + $y * $y)); } # Here are some plotting parameters $xmin = -5.0; $xmax = 5.0; $ymin = -5.0; $ymax = 5.0; $zmin = -5.0; $zmax = 5.0; # Grid resolution $nxpoints = 60; $nypoints = 60; $cmap = new ColorMap("cmap"); $frame = new FrameBuffer(500, 500); $frame->clear(BLACK); $p3 = new Plot3D($frame, $xmin, $ymin, $zmin, $xmax, $ymax, $zmax); $p3->lookat(2 * ($zmax - $zmin)); $p3->autoperspective(40); $p3->rotu(60); $p3->rotr(30); $p3->rotd(10); function drawsolid() { global $xmax; global $xmin; global $ymax; global $ymin; global $zmin; global $zmax;