ruvents / data-space
This package is abandoned and no longer maintained.
No replacement package was suggested.
RUVENTS Data Space
2.0.0-alpha15
2016-10-20 00:12 UTC
Requires
- php: >=5.4.0
- dev-master / 2.0.x-dev
- 2.0.x-dev
- 2.0.0-alpha15
- 2.0.0-alpha14
- 2.0.0-alpha13
- 2.0.0-alpha12
- 2.0.0-alpha11
- 2.0.0-alpha10
- 2.0.0-alpha9
- 2.0.0-alpha8
- 2.0.0-alpha7
- 2.0.0-alpha6
- 2.0.0-alpha5
- 2.0.0-alpha4
- 2.0.0-alpha3
- 2.0.0-alpha2
- 2.0.0-alpha1
- 1.0.x-dev
- 1.0.0-alpha5
- 1.0.0-alpha4
- 1.0.0-alpha3
- 1.0.0-alpha2
- 1.0.0-alpha1
This package is auto-updated.
Last update: 2017-12-20 08:16:53 UTC
README
Example
<?php
use Ruvents\DataSpace\Space;
$space = new Space(['x', 'y', 'z']);
$space->setPoint([1,1,1], 'Point 1, 1, 1');
$space->setPoint([3,2,4], 'Point 3, 2, 4');
$space->setPoint([5,2,1], 'Point 5, 2, 1');
$space->getAxis('x')->setCoordinate(1, 'Coordinate x1');
$space->getAxis('y')->setCoordinate(2, 'Coordinate y2');
$space->getAxis('z')->setCoordinate(4, 'Coordinate z4');
# for a grid (only existing points are displayed)
$xIterator = $space->getIterator();
foreach ($xIterator as $x => $yIterator) {
$xData = $xIterator->getCurrentCoordinate();
foreach ($yIterator as $y => $zIterator) {
$yData = $yIterator->getAxis()->getCoordinate($y);
foreach ($zIterator as $z => $point) {
$zData = $space->getAxis('z')->getCoordinate($z);
echo "Point at ($x, $y, $z). Point data: $point, xData: $xData, yData: $yData, zData: $zData<br>";
}
}
}
echo '<br>';
# for a table (all coordinates are displayed)
foreach ($space->getAxis('x') as $x => $xData) {
foreach ($space->getAxis('y') as $y => $yData) {
foreach ($space->getAxis('z') as $z => $zData) {
$point = $space->getPoint([$x, $y, $z], 'default');
echo "Point at ($x, $y, $z). Point data: $point, xData: $xData, yData: $yData, zData: $zData<br>";
}
}
}