You are here

public function Point::z in geoPHP 8

Same name and namespace in other branches
  1. 7 geoPHP/lib/geometry/Point.class.php \Point::z()

Returns Z (altitude) coordinate

Return value

float The Z coordinate or NULL is not a 3D point

Overrides Geometry::z

File

geoPHP/lib/geometry/Point.class.php, line 71

Class

Point
Point: The most basic geometry type. All other geometries are built out of Points.

Code

public function z() {
  if ($this->dimention == 3) {
    return $this->coords[2];
  }
  else {
    return NULL;
  }
}