File: examplehilbert.php

Recommend this page to a friend!
  Classes of Chi Hoang  >  PHP Delaunay Triangulation  >  examplehilbert.php  >  Download  
File: examplehilbert.php
Role: Example script
Content type: text/plain
Description: update
Class: PHP Delaunay Triangulation
Perform Delaunay triangulation for a set of points
Author: By
Last change: update
Date: 5 years ago
Size: 758 bytes
 

Contents

Class file image Download
<?php
/***************************************************************
* hilbert curve
* Version 0.3
*
* Copyright (c) 2010-2015 Chi Hoang
* All rights reserved
***************************************************************/
require_once("hilbert.php");

$hilbert=new hilbert();
foreach (
range(31,0,-1) as $x)
{
    foreach (
range(31,0,-1) as $y)
    {
   
$sort[] = $points["$x, $y"] = $hilbert->point2moore($x, $y, 4);
    }
}
array_multisort($points, $sort);
foreach (
$points as $k => $v)
{
    echo
$k."\n";
}
   
foreach (
range(7,0,-1) as $x)
{
    foreach (
range(7,0,-1) as $y)
    {
   
$sort[] = $points["$x, $y"] = $hilbert->point2hilbert($x, $y, 3);
    }
}
array_multisort($points, $sort);
foreach (
$points as $k => $v)
{
    echo
$k."\n";
}
?>


For more information send a message to info at phpclasses dot org.