Package eas.math.geometry

Examples of eas.math.geometry.Vector2D.translate()


                            verschPar.mult(30);
                            verschOrtho.ortho();
                            verschOrtho.norm();
                            verschOrtho.mult(-10);
                            Vector2D versch = new Vector2D(verschPar);
                            versch.translate(verschOrtho);
                           
                            x = (int) (((double) x1 + (double) x2) / 2.0
                                    + versch.x);
                            y = (int) (((double) y1 + (double) y2) / 2.0
                                    + versch.y);
View Full Code Here


                if (ZeichFen.this.vekClick != null) {
                    for (int i = 0; i < ZeichFen.this.pfeilPol.nPoints(); i++) {
                        if (ZeichFen.this.markierte.contains(i)) {
                           
                            neu = new Vector2D(ZeichFen.this.pfeilPol.get(i));
                            neu.translate(vek);
                            neu.sub(ZeichFen.this.ersteEcke);
                           
                            ZeichFen.this.pfeilPol.set(i, neu);
                        }
                    }
View Full Code Here

        zwisch.sub(ySub);
        quad.add(zwisch);

        zwisch = new Vector2D(linksOben.x, linksOben.y + radius * 4 + radius);
        zwisch.sub(xSub);
        zwisch.translate(ySub);
        quad.add(zwisch);

        zwisch = new Vector2D(linksOben.x, linksOben.y + radius * 4 + radius);
        zwisch.translate(xSub);
        zwisch.translate(ySub);
View Full Code Here

        zwisch.sub(xSub);
        zwisch.translate(ySub);
        quad.add(zwisch);

        zwisch = new Vector2D(linksOben.x, linksOben.y + radius * 4 + radius);
        zwisch.translate(xSub);
        zwisch.translate(ySub);
        quad.add(zwisch);

        zwisch = new Vector2D(linksOben.x, linksOben.y);
        zwisch.translate(xSub);
View Full Code Here

        zwisch.translate(ySub);
        quad.add(zwisch);

        zwisch = new Vector2D(linksOben.x, linksOben.y + radius * 4 + radius);
        zwisch.translate(xSub);
        zwisch.translate(ySub);
        quad.add(zwisch);

        zwisch = new Vector2D(linksOben.x, linksOben.y);
        zwisch.translate(xSub);
        zwisch.sub(ySub);
View Full Code Here

        zwisch.translate(xSub);
        zwisch.translate(ySub);
        quad.add(zwisch);

        zwisch = new Vector2D(linksOben.x, linksOben.y);
        zwisch.translate(xSub);
        zwisch.sub(ySub);
        quad.add(zwisch);
       
        AusgMerkm zwAusg = new AusgMerkm(Color.black, Color.black, true, true);
        liste.add(zwAusg);
View Full Code Here

            if (m.getZusatz() != null
                    && m.getZusatz().getClass().equals(Vector2D.class)) {
               
                zwisch = new Vector2D((Vector2D) m.getZusatz());
                zwisch.mult(skalierung);
                zwisch.translate(verschiebung);
                kreise.add(new Circle2D(zwisch, radius));
            }
        }
       
        return kreise;
View Full Code Here

        Vector2D pLO = new Vector2D(Geometry2D.rahmen(objekte).get(0));
        Vector2D pRU = new Vector2D(Geometry2D.rahmen(objekte).get(1));
       
        Vector2D neuVersch = new Vector2D(mitte);
        Vector2D zwisch = new Vector2D(pLO);
        zwisch.translate(new Vector2D((pRU.x - pLO.x) / 2, (pRU.y - pLO.y) / 2));
        zwisch.mult(skalierung);
        neuVersch.sub(zwisch);
        this.verschiebung = neuVersch;
    }
   
View Full Code Here

                    Vector2D d = this.getGradientAtCoordinate(v);
                   
                    if (!Double.isNaN(d.x) && !Double.isNaN(d.y)) {
                        Vector2D vecTemp = new Vector2D(v);
                        d.mult(3);
                        vecTemp.translate(d);
                        v = this.getPointInVisualization(v);
                        vecTemp = this.getPointInVisualization(vecTemp);
                        d = vecTemp.sub(v);
                       
                        g.fillOval((int) v.x - 5, (int) v.y - 5, 10, 10);
View Full Code Here

        double disturbanceFactor = 0.5;
        double gradientFactor = 0.3;
        Vector2D pos = this.getEnvironment().getAgentPosition(this.id());
        Vector2D vec = new Vector2D(this.getEnvironment().getGradientAtCoordinate(pos));
        vec.mult(gradientFactor);
        vec.translate(new Vector2D(
                (rand.nextDouble() - 0.5) * disturbanceFactor,
                (rand.nextDouble() - 0.5) * disturbanceFactor));
       
        Vector2D newPos = new Vector2D(vec).translate(pos);
        Vector2D newPos1 = new Vector2D(vec).translate(pos).translate(new Vector2D(agentRad, agentRad));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.