Page Menu
Home
Code
Search
Configure Global Search
Log In
Files
F948037
point3D.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
point3D.php
View Options
<?php
/*
* Geo point 3D class
*
* 0.1 2010-02-23 14:14 DcK
*
* @package Zed
* @subpackage Geo
* @copyright Copyright (c) 2010, Dereckson
* @license Released under BSD license
* @version 0.1
*
*/
class
GeoPoint3D
implements
IteratorAggregate
{
//
// x, y, z public properties
//
/*
* @var integer the x coordinate
*/
public
$x
;
/*
* @var integer the y coordinate
*/
public
$y
;
/*
* @var integer the z coordinate
*/
public
$z
;
//
// constructor / toString
//
/*
* Initializes a new instance of GeoPoint3D class
*/
function
__construct
(
$x
,
$y
,
$z
)
{
$this
->
x
=
$x
;
$this
->
y
=
$y
;
$this
->
z
=
$z
;
}
/*
* Returns a xyz: [x, y, z] string representation of the point coordinates
*/
function
__toString
()
{
return
sprintf
(
"xyz: [%d, %d, %d]"
,
$this
->
x
,
$this
->
y
,
$this
->
z
);
}
//
// Implementing IteratorAggregate
//
/*
* Retrieves class iterator. It traverses x, y and z.
* @return Traversable the iterator
*/
function
getIterator
()
{
return
new
ArrayIterator
(
$this
);
}
}
?>
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Apr 26, 14:31 (7 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
22882
Default Alt Text
point3D.php (1 KB)
Attached To
rZEDHG ZedLegacy
Event Timeline
Log In to Comment