Package eas.math.geometry

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


        // Wall-Follow:
        final double epsilon = 0.1;
        int wf = 0;
        Vector2D blick = new Vector2D(rob.getBlickrichtung());
        blick.norm();
//        if (Math.abs(blick.y) < epsilon) {
        if (Math.abs(blick.x) < epsilon || Math.abs(blick.y) < epsilon) {
            wf++;
        } else {
            wf--;
View Full Code Here


                        pos,
                        env.getNormalizedLOV(PacmanGhostAgent.this.id()),
                        PacmanGhostAgent.ignorelist);

                zwisch = new Vector2D(pos);
                zwisch.norm();
                zwisch.setLength(3);

                pos.sub(zwisch);

                CollisionData collision1 = env.nearestRayCollision(pos,
View Full Code Here

                y2 = (int) y2d;
            } else {
                Vector2D v0 = new Vector2D(x2, y2);
                v0.sub(new Vector2D(x1, y1));
                v0.ortho();
                v0.norm();
                v0.mult(12);
               
                x1 += v0.x;
                x2 += v0.x;
                y1 += v0.y;
View Full Code Here

            Vector2D v = new Vector2D(x2, y2);
            double dist = new Vector2D(x1, y1).distance(new Vector2D(x2, y2));
           
            v.sub(new Vector2D(x1, y1));
            v.norm();
            v.mult(this.pfeilSpLaenge);
            Vector2D v1 = new Vector2D(x1, y1);
            Vector2D v2 = new Vector2D(x2, y2);
            v2.sub(v);
           
View Full Code Here

                            y2 = pol.ypoints[1];

                            Vector2D verschOrtho = new Vector2D(x1, y1);
                            verschOrtho.sub(new Vector2D(x2, y2));
                            Vector2D verschPar = new Vector2D(verschOrtho);
                            verschPar.norm();
                            verschPar.mult(30);
                            verschOrtho.ortho();
                            verschOrtho.norm();
                            verschOrtho.mult(-10);
                            Vector2D versch = new Vector2D(verschPar);
View Full Code Here

                    norm = new Vector2D(letzte[j].x, letzte[j].y);
                    norm.sub(new Vector2D(
                            rob.getPosition().x,
                            rob.getPosition().y));
                    norm.ortho();
                    norm.norm();
                   
                    lang = rob.getFitSum();
                   
                    if (lang <= 0) {
                        lang = 5;
View Full Code Here

                                     Vector2D.NULL_VECTOR);
           
        } 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;
View Full Code Here

            return null;
        }
        angle = new Double(angle / 180 * Math.PI);
        vec = new Vector2D(0, 1);
        vec.rotate(Vector2D.NULL_VECTOR, angle);
        vec.norm();
        return vec;
    }
   
    /**
     * @param agent  Some agent in the environment.
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.