Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Chi Hoang  >  PHP Delaunay Triangulation  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example
Class: PHP Delaunay Triangulation
Perform Delaunay triangulation for a set of points
Author: By
Last change: Turn off all error reporting
Date: 8 months ago
Size: 780 bytes
 

Contents

Class file image Download
<?php

/***************************************************************
* Copyright notice
*
* (c) 2010-2013 Chi Hoang (info@chihoang.de)
*  All rights reserved
*
***************************************************************/
require_once("delaunay.php");

// Turn off all error reporting
error_reporting(0);
 
// example 1
$triangle=new DelaunayTriangulation();
$triangle->main();

$vis=new visualize("c:\Temp\\",$triangle);
$vis->genimage();
      
//example2
$set=array();
$tree=array(172,31,238,106,233,397,118,206,58,28,268,382,10,380,342,26,67,371,380,14,382,200,24,200,194,190,10,88,276);
for (
$i=0,$end=count($tree);$i<$end;$i+=2)
{
    
$set[]=array($tree[$i],$tree[$i+1]);    
}
$triangle->main($set);
 
$vis=new visualize("/tmp/",$triangle);
$vis->genimage(); 
  
 
?>