Package eas.math.geometry

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


           
        } else {
            Vector2D vv = new Vector2D(x2, y2);
            vv.sub(new Vector2D(x1, y1));
            vv.norm();
            vv.mult(35);
           
            x1 += vv.x;
            y1 += vv.y;
            x2 -= vv.x;
            y2 -= vv.y;
View Full Code Here


        for (AbstractMsg m : liste) {
            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));
            }
        }
       
View Full Code Here

        if (this.pfeilPol.nPoints() <= 0) {
            return null;
        }
       
        Vector2D versch = new Vector2D(this.pfeilPol.get(0));
        versch.mult(-1);
       
        Vector2D anfWin = new Vector2D(this.pfeilPol.get(1));
        anfWin.sub(this.pfeilPol.get(0));
        double winkel = Math.atan(anfWin.x / anfWin.y);
       
View Full Code Here

        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

//        super.step(simTime);
        RescuerContinousEnv env = (RescuerContinousEnv) this.getMyBody().getEnvironment();
       
        Vector2D pos = new Vector2D(env.getAgentPosition(this.getMyBody().id()));
        Vector2D gradient = env.getGradientAtCoordinate(pos);
        gradient.mult(0.2);
        pos.translate(gradient);
        env.setAgentPosition(this.getMyBody().id(), pos);
       
        if (simTime.getLastTick() == 0) {
            env.setWheelErrorLeft(this.getMyBody().id(), this.getMyBody().getRand().nextDouble(), 0);
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);
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.