move a triangle's point to new position
342929
function setTarget(p) {
  if (!p) p = space.size.$multiply( Math.random(), Math.random() );
  timeInc++;
  target.p++;
  target.t = 0;
  target.vec = p;
}
786598
def move(self, target, pos=None):
        '''
        
        '''
        if self.outline != target.outline:
            raise IntegrityError('Elements must be from the same outline!')
        tree_manipulation.send(
            sender=self.__class__,
            instance=self,
            action='move',
            target_node_type=None,
            target_node=target,
            pos=pos
        )
        return super().move(target, pos)
1107901
public static final Point move(Point p, double radians, double distance)
    {
        return new AbstractPoint(
                p.getX() + distance*Math.cos(radians),
                p.getY() + distance*Math.sin(radians)
                );
    }
648889
def move(self, delta):
        
        self.pos = (self.pos[0]+delta[0], self.pos[1]+delta[1])
1040466
private static Coordinate moveCoordinate(Coordinate inputCoordinate, double[] shadowOffset) {
        return new Coordinate(inputCoordinate.x + shadowOffset[0], inputCoordinate.y + shadowOffset[1], 0);
    }
380007
def _move_end_to_cxn(self, shape, cxn_pt_idx):
        
        x, y, cx, cy = shape.left, shape.top, shape.width, shape.height
        self.end_x, self.end_y = {
            0: (int(x + cx/2), y),
            1: (x, int(y + cy/2)),
            2: (int(x + cx/2), y + cy),
            3: (x + cx, int(y + cy/2)),
        }[cxn_pt_idx]
1362977
private void move1() {
        if (node == null)
            return;

        if (position >= reference.size()) {
            node = null;
            return;
        }

        node = node.links[reference.codeAt(position++)];
    }
268846
public Triangle setPoints(final Point2D a, final Point2D b, final Point2D c)
    {
        return setPoint2DArray(new Point2DArray(a, b, c));
    }
12035
function(other, t) {
            var newpos = this.pos.lerp(other.pos, t);
            return new CSG.Vertex(newpos);
        }
524877
protected void moveRightToLeft() {
        Object[] chosenSelectedValues = chosenList.getSelectedValues();
        int nChosenSelected = chosenSelectedValues.length;
        int[] chosenSelected = new int[nChosenSelected];

        if (nChosenSelected == 0) {
            return; // Nothing to move
        }

        // Get our current selection
        int[] currentSelected = helperList.getSelectedIndices();
        int nCurrentSelected = currentSelected.length;

        // Fill the chosenSelected array with the indices of the selected chosen
        // items
        for (int i = 0; i < nChosenSelected; i++) {
            chosenSelected[i] = indexOf(chosenSelectedValues[i]);
        }

        // Construct the new selected indices. Loop through the current list
        // and compare to the head of the chosen list. If not equal, then add
        // to the new list. If equal, skip it and bump the head pointer on the
        // chosen list.

        int newSelection[] = new int[nCurrentSelected - nChosenSelected];
        int newSelPos = 0;
        int chosenPos = 0;

        for (int i = 0; i < nCurrentSelected; i++) {
            int currentIdx = currentSelected[i];
            if (chosenPos < nChosenSelected && currentIdx == chosenSelected[chosenPos]) {
                chosenPos += 1;
            } else {
                newSelection[newSelPos++] = currentIdx;
            }
        }

        // Install the new selection
        helperList.setSelectedIndices(newSelection);
        update();
    }
846747
def random_point_triangle(triangle, use_int_coords=True):
        
        xs, ys = triangle.exterior.coords.xy
        A, B, C = zip(xs[:-1], ys[:-1])
        r1, r2 = np.random.rand(), np.random.rand()
        rx, ry = (1 - sqrt(r1)) * np.asarray(A) + sqrt(r1) * (1 - r2) * np.asarray(B) + sqrt(r1) * r2 * np.asarray(C)
        if use_int_coords:
            rx, ry = round(rx), round(ry)
            return Point(int(rx), int(ry))
        return Point(rx, ry)
453584
def point(self, x, y, z=0, m=0):
        """"""
        pointShape = _Shape(self.shapeType)
        pointShape.points.append([x, y, z, m])
        self._shapes.append(pointShape)
1175177
def move_edge_source(self, edge_id, node_a, node_b):
        """"""
        # Grab the edge
        edge = self.get_edge(edge_id)

        # Alter the vertices
        edge['vertices'] = (node_b, edge['vertices'][1])

        # Remove the edge from node_a
        node = self.get_node(node_a)
        node['edges'].remove(edge_id)

        # Add the edge to node_b
        node = self.get_node(node_b)
        node['edges'].append(edge_id)
78824
def relocate(self, lon):
        
        self.lon = angle.norm(lon)
        self.signlon = self.lon % 30
        self.sign = const.LIST_SIGNS[int(self.lon / 30.0)]
849918
public void moveItem(Point oldCoordinates, Point newCoordinates) {
	assertEDT();
	if (oldCoordinates == null || newCoordinates == null) {
	    throw new IllegalArgumentException("Coordinates cannot be null");
	}
	if (getPanelAt(newCoordinates).hasModel()) {
	    throw new IllegalStateException(
		    "New position contains a model in the UI already. New position = " + newCoordinates);
	}
	if (!getPanelAt(oldCoordinates).hasModel()) {
	    throw new IllegalStateException("Old position doesn't contain a model in the UI. Old position = "
		    + oldCoordinates);
	}
	// all good
	Drawable item = getPanelAt(oldCoordinates).getModel();
	removeItem(oldCoordinates);
	addItem(newCoordinates, item);

    }
1205917
function(x, y) {
            var oldX = this.x, oldY = this.y;
            OpenLayers.Geometry.Point.prototype.move.call(this, x, y);
            if(control._moving) {
                return;
            }
            var evt = control.dragControl.handlers.drag.evt;
            var preserveAspectRatio = !control._setfeature &&
                control.preserveAspectRatio;
            var reshape = !preserveAspectRatio && !(evt && evt.shiftKey);
            var oldGeom = new OpenLayers.Geometry.Point(oldX, oldY);
            var centerGeometry = control.center;
            this.rotate(-control.rotation, centerGeometry);
            oldGeom.rotate(-control.rotation, centerGeometry);
            var dx1 = this.x - centerGeometry.x;
            var dy1 = this.y - centerGeometry.y;
            var dx0 = dx1 - (this.x - oldGeom.x);
            var dy0 = dy1 - (this.y - oldGeom.y);
            if (control.irregular && !control._setfeature) {
               dx1 -= (this.x - oldGeom.x) / 2;
               dy1 -= (this.y - oldGeom.y) / 2;
            }
            this.x = oldX;
            this.y = oldY;
            var scale, ratio = 1;
            if (reshape) {
                scale = Math.abs(dy0) < 0.00001 ? 1 : dy1 / dy0;
                ratio = (Math.abs(dx0) < 0.00001 ? 1 : (dx1 / dx0)) / scale;
            } else {
                var l0 = Math.sqrt((dx0 * dx0) + (dy0 * dy0));
                var l1 = Math.sqrt((dx1 * dx1) + (dy1 * dy1));
                scale = l1 / l0;
            }

            // rotate the box to 0 before resizing - saves us some
            // calculations and is inexpensive because we don't drawFeature.
            control._moving = true;
            control.box.geometry.rotate(-control.rotation, centerGeometry);
            delete control._moving;

            control.box.geometry.resize(scale, centerGeometry, ratio);
            control.box.geometry.rotate(control.rotation, centerGeometry);
            control.transformFeature({scale: scale, ratio: ratio});
            if (control.irregular && !control._setfeature) {
               var newCenter = centerGeometry.clone();
               newCenter.x += Math.abs(oldX - centerGeometry.x) < 0.00001 ? 0 : (this.x - oldX);
               newCenter.y += Math.abs(oldY - centerGeometry.y) < 0.00001 ? 0 : (this.y - oldY);
               control.box.geometry.move(this.x - oldX, this.y - oldY);
               control.transformFeature({center: newCenter});
            }
        }
335535
def move_point_num(point, to_clust, from_clust, cl_attr_sum, cl_memb_sum):
    """"""
    # Update sum of attributes in cluster.
    for iattr, curattr in enumerate(point):
        cl_attr_sum[to_clust][iattr] += curattr
        cl_attr_sum[from_clust][iattr] -= curattr
    # Update sums of memberships in cluster
    cl_memb_sum[to_clust] += 1
    cl_memb_sum[from_clust] -= 1
    return cl_attr_sum, cl_memb_sum