Java 8 Point2D.Double - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 Point2D.Double class.

This code example shows how to use the following methods:getX, getY
 
        //extract point objects from source array 
        Point2D p0 = new Point2D.Double(cubicControlPointCoords[0], cubicControlPointCoords[1]);
        Point2D p1 = new Point2D.Double(cubicControlPointCoords[2], cubicControlPointCoords[3]);
        Point2D p2 = new Point2D.Double(cubicControlPointCoords[4], cubicControlPointCoords[5]);
        Point2D p3 = new Point2D.Double(cubicControlPointCoords[6], cubicControlPointCoords[7]);
 
        //calculates the useful base points 
        Point2D pa = getPointOnSegment(p0, p1, 3.0 / 4.0);
        Point2D pb = getPointOnSegment(p3, p2, 3.0 / 4.0);
 
        //get 1/16 of the [P3, P0] segment 
        double dx = (p3.getX() - p0.getX()) / 16.0;
        double dy = (p3.getY() - p0.getY()) / 16.0;
 
        //calculates control point 1 
        Point2D pc1 = getPointOnSegment(p0, p1, 3.0 / 8.0);
 
        //calculates control point 2 
        Point2D pc2 = getPointOnSegment(pa, pb, 3.0 / 8.0);

4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
	} 
 
	@Test
	public void testRaceTypeUnset5Square() 
	{ 
		assertEquals(new Point2D.Double(5, 0), facet.getFace(id));
	} 
 
	@Test
	public void testWithNothingInRace() 
	{ 
		rfacet.set(id, new Race());
		assertEquals(new Point2D.Double(5, 0), facet.getFace(id));
	} 
 
	@Test
	public void testAvoidPollution() 
	{ 
		Race r = new Race();
		r.put(IntegerKey.LEGS, 5);
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
 
    PipesLayoutData(double x1, double y1, double x2, double y2) {
        points = new Point2D.Double[3];
        points[0] = new Point2D.Double(x1, y1);
        points[1] = new Point2D.Double(x2, y1);
        points[2] = new Point2D.Double(x2, y2);
        totalLength = Math.abs(x1 - x2) + Math.abs(y1 - y2);
        maxLength = totalLength;
    } 
 
    @Override 
    public Double[] getSubdivisonPoints() {
        return points;
    } 
 
    @Override 
    public double getEdgeSortOrder() { 
        return totalLength; // first renderer : let's make edges with higher length higher priority
    } 
 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Java 8 Point2D.Double Methods: