public static function getDirectionByPoints(PointInterface $point1, PointInterface $point2)
    {
        if (self::areSameSpace($point1, $point2)) {
            $directions = array(
                0 => self::getDirectionByCoordinates($point1->getAbscissa(), $point2->getAbscissa())
            );
            if ($point1->is2D() || $point1->is3D()) {
                $directions[1] = self::getDirectionByCoordinates($point1->getOrdinate(), $point2->getOrdinate());
            }
            if ($point1->is3D()) {
                $directions[2] = self::getDirectionByCoordinates($point1->getApplicate(), $point2->getApplicate());
            }
            return $directions;
        } else {
            throw new \InvalidArgumentException(
                "Can not guess directions between two points of different space types"
            );
        }
    }