Return given point reflected around planes in N dimensions.
There must be the same number of planes as dimensions, but the value of each
  plane may be None to indicate no reflection.
765675
def pt_reflect(pt=(0.0, 0.0), plane=[None, None]):
    '''
    '''
    assert isinstance(pt, tuple)
    l_pt = len(pt)
    assert l_pt > 1
    for i in pt:
        assert isinstance(i, float)
    assert isinstance(plane, list)
    l_pl = len(plane)
    assert l_pl == l_pt
    for i in plane:
        assert isinstance(i, float) or i is None

    return tuple([pt[i] if plane[i] is None else (2*plane[i] - pt[i]) for i in range(l_pt)])
1076690
def multipointm(self, points):
        """"""
        shapeType = MULTIPOINTM
        points = [points] # nest the points inside a list to be compatible with the generic shapeparts method
        self._shapeparts(parts=points, shapeType=shapeType)
1317568
private static void reflect(Tuple2d p, Tuple2d base, double a, double b) {
        double x = a * (p.x - base.x) + b * (p.y - base.y) + base.x;
        double y = b * (p.x - base.x) - a * (p.y - base.y) + base.y;
        p.x = x;
        p.y = y;
    }
50484
def ndim(self) -> int:
        """"""
        try:
            assert self._ndim is not None
        except (AssertionError, AttributeError):
            if len(self.variables) == 0:
                self._ndim = 0
            else:
                self._ndim = self.variables[0].ndim
        finally:
            return self._ndim
1279152
def reflect(self, data, width):
        
        x = data & 0x01
        for i in range(width - 1):
            data >>= 1
            x = (x << 1) | (data & 0x01)
        return x
778991
boolean hasPointFeatures()
    {
      for (int geometry = getFirstGeometry(); geometry != -1; geometry = getNextGeometry(geometry))
      {
        if (!Geometry.isMultiPath(getGeometryType(geometry)))
          return true;
      }
      return false;
    }
515910
def t(self):
        
        t = np.array([self._plane_width / 2,
                      self._plane_height / 2,
                      self._depth_scale / 2])
        return t
346405
private static boolean multiPointIntersectsMultiPoint_(
			MultiPoint _multipointA, MultiPoint _multipointB, double tolerance,
			ProgressTracker progress_tracker) {
		MultiPoint multipoint_a;
		MultiPoint multipoint_b;

		if (_multipointA.getPointCount() > _multipointB.getPointCount()) {
			multipoint_a = _multipointB;
			multipoint_b = _multipointA;
		} else {
			multipoint_a = _multipointA;
			multipoint_b = _multipointB;
		}

		Envelope2D env_a = new Envelope2D();
		Envelope2D env_b = new Envelope2D();
		Envelope2D envInter = new Envelope2D();
		multipoint_a.queryEnvelope2D(env_a);
		multipoint_b.queryEnvelope2D(env_b);
		env_a.inflate(tolerance, tolerance);
		env_b.inflate(tolerance, tolerance);
		envInter.setCoords(env_a);
		envInter.intersect(env_b);

		Point2D ptA = new Point2D();
		Point2D ptB = new Point2D();
		double tolerance_sq = tolerance * tolerance;

		QuadTreeImpl quadTreeB = InternalUtils.buildQuadTree(
				(MultiPointImpl) (multipoint_b._getImpl()), envInter);
		QuadTreeImpl.QuadTreeIteratorImpl qtIterB = quadTreeB.getIterator();

		for (int vertex_a = 0; vertex_a < multipoint_a.getPointCount(); vertex_a++) {
			multipoint_a.getXY(vertex_a, ptA);

			if (!envInter.contains(ptA))
				continue;

			env_a.setCoords(ptA.x, ptA.y, ptA.x, ptA.y);
			qtIterB.resetIterator(env_a, tolerance);

			for (int elementHandleB = qtIterB.next(); elementHandleB != -1; elementHandleB = qtIterB
					.next()) {
				int vertex_b = quadTreeB.getElement(elementHandleB);
				multipoint_b.getXY(vertex_b, ptB);

				if (Point2D.sqrDistance(ptA, ptB) <= tolerance_sq)
					return true;
			}
		}

		return false;
	}
1217858
def geom_reflect(g, nv):
    

    # Imports
    import numpy as np

    # Force g to n-vector
    g = make_nd_vec(g, nd=None, t=np.float64, norm=False)

    # Transform the geometry and return
    refl_g = np.dot(mtx_refl(nv, reps=(g.shape[0] // 3)), g) \
                .reshape((g.shape[0],1))
    return refl_g
377442
def mirror(self, axes='x'):
        
        polygon = np.array([[0,0], [0,1], [1,1]])
        space = Space(Place(polygon, polyhedra=self))
        return space.mirror(axes, inplace=False)[0].polyhedra[0]
978954
def _within_box(points, boxes):
    
    x_within = (points[..., 0] >= boxes[:, 0, None]) & (
        points[..., 0] <= boxes[:, 2, None]
    )
    y_within = (points[..., 1] >= boxes[:, 1, None]) & (
        points[..., 1] <= boxes[:, 3, None]
    )
    return x_within & y_within
232416
def verify_no_new_dims(input_shapes, output_shape):
  
  all_input_dims = set(sum([s.dims for s in input_shapes], []))
  all_output_dims = set(output_shape.dims)
  if not all_output_dims.issubset(all_input_dims):
    raise ValueError(
        "No new dimensions allowed in output"
        " input_shapes = %s output_shape= %s"
        % ([s.dims for s in input_shapes], output_shape.dims))
1323159
def example_point(self):
        
        return np.array([([self.n_meas] + [0] * (self.n_elements-1),)], dtype=self.dtype)
799681
public Matrix4x3d reflection(Vector3dc normal, Vector3dc point) {
        return reflection(normal.x(), normal.y(), normal.z(), point.x(), point.y(), point.z());
    }
837688
def plane
      # Such a change is only possible if the Slice instance has a Contour with at least three Coordinates:
      raise "This Slice does not contain a Contour. Plane determination is not possible." if @contours.length == 0
      raise "This Slice does not contain a Contour with at least 3 Coordinates. Plane determination is not possible." if @contours.first.coordinates.length < 3
      # Get three coordinates from our Contour:
      contour = @contours.first
      num_coords = contour.coordinates.length
      c1 = contour.coordinates.first
      c2 = contour.coordinates[num_coords / 3]
      c3 = contour.coordinates[2 * num_coords / 3]
      return Plane.calculate(c1, c2, c3)
    end
966534
function Plane(a, b, c, d) {
            this.normal = new Vector3(a, b, c);
            this.d = d;
        }
333540
def f(self, m):
        '''  '''
        M = reshape(m,self.input_dim)
        n = M.shape[0]
        if M.shape[1] != self.input_dim:
            return 'Wrong input dimension'
        else:
            S = self.environment.update(M)
            m = M[0]
            s = S[0]
            # Store the points (m,s) explored during the optimisation
            self.pointsList.append((m,s))
            return self.dist_array(S)