Fills the ordered list with the corners in target node in canonical order.

@param pointingX true if 'node' is pointing along the x-axis from target.  false for point along y-axis
962603
protected void orderNode(SquareNode target, SquareNode node, boolean pointingX) {

		int index0 = findIntersection(target,node);
		int index1 = (index0+1)%4;

		int index2 = (index0+2)%4;
		int index3 = (index0+3)%4;

		if( index0 < 0 )
			throw new RuntimeException("Couldn't find intersection.  Probable bug");

		lineCenters.a = target.center;
		lineCenters.b = node.center;
		UtilLine2D_F64.convert(lineCenters,general);

		Polygon2D_F64 poly = target.square;
		if( pointingX ) {
			if (sign(general, poly.get(index0)) > 0) {
				ordered[1] = poly.get(index1);
				ordered[2] = poly.get(index0);
			} else {
				ordered[1] = poly.get(index0);
				ordered[2] = poly.get(index1);
			}
			if (sign(general, poly.get(index2)) > 0) {
				ordered[3] = poly.get(index2);
				ordered[0] = poly.get(index3);
			} else {
				ordered[3] = poly.get(index3);
				ordered[0] = poly.get(index2);
			}
		} else {
			if (sign(general, poly.get(index0)) > 0) {
				ordered[2] = poly.get(index1);
				ordered[3] = poly.get(index0);
			} else {
				ordered[2] = poly.get(index0);
				ordered[3] = poly.get(index1);
			}
			if (sign(general, poly.get(index2)) > 0) {
				ordered[0] = poly.get(index2);
				ordered[1] = poly.get(index3);
			} else {
				ordered[0] = poly.get(index3);
				ordered[1] = poly.get(index2);
			}
		}
	}
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)
303754
public static float pointLineDistSq (float px, float py,
                                         float x1, float y1, float x2, float y2) {
        x2 -= x1;
        y2 -= y1;
        px -= x1;
        py -= y1;
        float s = px * y2 - py * x2;
        return (s * s) / (x2 * x2 + y2 * y2);
    }
1155682
@Override
	public void setCenter(Point3D center) {
		this.cx = center.getX();
		this.cy = center.getY();
		this.cz = center.getZ();
	}
1137508
public void removePoint(int index) {
        int numKnots = x.length;
        if (numKnots <= 2)
            return;
        float[] nx = new float[numKnots - 1];
        float[] ny = new float[numKnots - 1];
        int j = 0;
        for (int i = 0; i < numKnots - 1; i++) {
            if (i == index)
                j++;
            nx[i] = x[j];
            ny[i] = y[j];
            j++;
        }
        x = nx;
        y = ny;
    }
1035700
boolean assignLayout(IAtomContainer container) {

        try {
            // create the library key to lookup an entry, we also store
            // the canonical out ordering
            int n = container.getAtomCount();
            int[] ordering = new int[n];
            String smiles = cansmi(container, ordering);

            // find the points in the library
            for (Point2d[] points : templateMap.get(smiles)) {
                // set the points
                for (int i = 0; i < n; i++) {
                    container.getAtom(i).setPoint2d(new Point2d(points[ordering[i]]));
                }
                return true;
            }
        } catch (CDKException e) {
            // ignored
        }
        return false;
    }
1059293
public void pointTo(Object baseObject, long baseOffset, int sizeInBytes) {
    // Read the number of elements from the first 8 bytes.
    final long numElements = Platform.getLong(baseObject, baseOffset);
    assert numElements >= 0 : "numElements (" + numElements + ") should >= 0";
    assert numElements <= Integer.MAX_VALUE :
      "numElements (" + numElements + ") should <= Integer.MAX_VALUE";

    this.numElements = (int)numElements;
    this.baseObject = baseObject;
    this.baseOffset = baseOffset;
    this.sizeInBytes = sizeInBytes;
    this.elementOffset = baseOffset + calculateHeaderPortionInBytes(this.numElements);
  }
500614
private void paint(Object parent, String name, Point point, GraphicsContext graphics) {
		if (!point.isEmpty()) {
			paint(parent, name + ".coordinate0", point.getCoordinate(), graphics);
		}
	}
475612
@Override
	public void setCenter(Point3D center) {
		this.cxProperty.set(center.getX());
		this.cyProperty.set(center.getY());
		this.czProperty.set(center.getZ());
	}
1007809
private List<Coordinate> sortX(List<Coordinate> coordinates) {
		List<Coordinate> sorted = new ArrayList<Coordinate>(coordinates);
		Collections.sort(sorted, new XComparator());
		return sorted;
	}
1010644
public void add(ESRIPoint point) {
		if (point.getX() < this.minx) {
			this.minx = point.getX();
		}
		if (point.getX() > this.maxx) {
			this.maxx = point.getX();
		}
		if (point.getY() < this.miny) {
			this.miny = point.getY();
		}
		if (point.getY() > this.maxy) {
			this.maxy = point.getY();
		}
		if (point.getZ() < this.minz) {
			this.minz = point.getZ();
		}
		if (point.getZ() > this.maxz) {
			this.maxz = point.getZ();
		}
		if (point.getM() < this.minm) {
			this.minm = point.getM();
		}
		if (point.getM() > this.maxm) {
			this.maxm = point.getM();
		}
	}
1110298
@Pure
	boolean containsControlPoint(Point3D p) {
		double x, y, z;
		for(int i=0; i<this.numCoordsProperty.get();) {
			x = this.coordsProperty[i++].get();
			y = this.coordsProperty[i++].get();
			z = this.coordsProperty[i++].get();
			if (x==p.getX() && y==p.getY() && z==p.getZ()) {
				return true;
			}
		}
		return false;
	}
880562
public void prepareTriangulation( TriangulationContext<?> tcx )
    {
        int hint = _points.size();
        if(_steinerPoints != null) {
            hint += _steinerPoints.size();
        }
        if( _holes != null ) {
            for (Polygon p : _holes) {
                hint += p.pointCount();
            }
        }
        HashMap<TriangulationPoint, TriangulationPoint> uniquePts = new HashMap<TriangulationPoint, TriangulationPoint>(hint);
        TriangulationPoint.mergeInstances(uniquePts, _points);
        if(_steinerPoints != null) {
            TriangulationPoint.mergeInstances(uniquePts, _steinerPoints);
        }
        if( _holes != null ) {
            for (Polygon p : _holes) {
                TriangulationPoint.mergeInstances(uniquePts, p._points);
            }
        }
        if( m_triangles == null )
        {
            m_triangles = new ArrayList<DelaunayTriangle>( _points.size() );
        }
        else
        {
            m_triangles.clear();
        }

        // Outer constraints
        for( int i = 0; i < _points.size()-1 ; i++ )
        {
            tcx.newConstraint( _points.get( i ), _points.get( i+1 ) );
        }
        tcx.newConstraint( _points.get( 0 ), _points.get( _points.size()-1 ) );

        // Hole constraints
        if( _holes != null )
        {
            for( Polygon p : _holes )
            {
                for( int i = 0; i < p._points.size()-1 ; i++ )
                {
                    tcx.newConstraint( p._points.get( i ), p._points.get( i+1 ) );
                }
                tcx.newConstraint( p._points.get( 0 ), p._points.get( p._points.size()-1 ) );            
            }
        }
        tcx.addPoints(uniquePts.keySet());
    }
204025
protected void bicoUpdate(double[] x) {
		assert (!this.bufferPhase && this.numDimensions == x.length);
		// Starts with the global root node as the current root node
		ClusteringTreeNode r = this.root;
		int i = 1;
		while (true) {
			ClusteringTreeNode y = r.nearestChild(x);
			// Checks if the point can not be added to the current level
			if (r.hasNoChildren()
					|| y == null
					|| Metric.distanceSquared(x, y.getCenter()) > calcRSquared(i)) {
				// Creates a new node for the point and adds it to the current
				// root node
				r.addChild(new ClusteringTreeNode(x, new ClusteringFeature(x, calcR(i))));
				this.rootCount++;
				break;
			} else {
				// Checks if the point can be added to the nearest node without
				// exceeding the global threshold
				if (y.getClusteringFeature().calcKMeansCosts(y.getCenter(), x) <= this.T) {
					// Adds the point to the ClusteringFeature
					y.getClusteringFeature().add(1, x, Metric.distanceSquared(x));
					break;
				} else {
					// Navigates one level down in the tree
					r = y;
					i++;
				}
			}
		}
		// Checks if the number of nodes in the tree exceeds the maximum number
		if (this.rootCount > this.maxNumClusterFeatures) {
			rebuild();
		}
	}
1159123
public static Point3d centroid(Point3d[] x) {
		Point3d center = new Point3d();
		for (Point3d p : x) {
			center.add(p);
		}
		center.scale(1.0 / x.length);
		return center;
	}
1138422
private Point asPoint(List coords, CrsId crsId) throws IOException {
        if (coords != null && coords.size() >= 2) {
            ArrayList<List> coordinates = new ArrayList<List>();
            coordinates.add(coords);
            return new Point(getPointSequence(coordinates, crsId));
        } else {
            throw new IOException("A point must has exactly one coordinate (an x, a y and possibly a z value). Additional numbers in the coordinate are permitted but ignored.");
        }
    }
882492
public void queryCorners(Point2D[] corners) {
		if ((corners == null) || (corners.length < 4))
			throw new IllegalArgumentException();
		if (corners[0] != null)
			corners[0].setCoords(xmin, ymin);
		else
			corners[0] = new Point2D(xmin, ymin);

		if (corners[1] != null)
			corners[1].setCoords(xmin, ymax);
		else
			corners[1] = new Point2D(xmin, ymax);

		if (corners[2] != null)
			corners[2].setCoords(xmax, ymax);
		else
			corners[2] = new Point2D(xmax, ymax);

		if (corners[3] != null)
			corners[3].setCoords(xmax, ymin);
		else
			corners[3] = new Point2D(xmax, ymin);
	}