Package eas.math.geometry

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


        double fges = 0;

        for (int i = 0; i < agentlist.size(); i++) {
            Vector2D pos = new Vector2D(agentlist.get(i).getPosition().getX(),
                    agentlist.get(i).getPosition().getY());
            if (pos.distance(this.getAgentPosition(agentID)) <= PanicAgent.radius * 2) {
                fges += agentlist.get(i).getForce().length();
            }
        }

        return fges;
View Full Code Here


        double currDist;
        Vector2D pos = this.getAgentPosition(agent.id());
       
        for (AbstractAgent2D<?> a : this.agents2D.values()) {
            if (a != agent) {
                currDist = pos.distance(this.getAgentPosition(a.id()));
                if (currDist < distance)  {
                    nearest = a;
                    distance = currDist;
                }
            }
View Full Code Here

            int x1 = (int) Math.floor(pointInMatrix.x);
            int x2 = (int) Math.ceil(pointInMatrix.x);
            int y1 = (int) Math.floor(pointInMatrix.y);
            int y2 = (int) Math.ceil(pointInMatrix.y);
   
                if (pointInMatrix.distance(new Vector2D(x1, y1)) < pointInMatrix.distance(new Vector2D(x2, y2))) {
                    planePoint1 = new Vector3D(x1, y1, this.heightProfile.get(x1, y1));
                } else {
                    planePoint1 = new Vector3D(x2, y2, this.heightProfile.get(x2, y2));
                }
                planePoint2 = new Vector3D(x2, y1, this.heightProfile.get(x2, y1));
View Full Code Here

            int x1 = (int) Math.floor(pointInMatrix.x);
            int x2 = (int) Math.ceil(pointInMatrix.x);
            int y1 = (int) Math.floor(pointInMatrix.y);
            int y2 = (int) Math.ceil(pointInMatrix.y);
   
                if (pointInMatrix.distance(new Vector2D(x1, y1)) < pointInMatrix.distance(new Vector2D(x2, y2))) {
                    planePoint1 = new Vector3D(x1, y1, this.heightProfile.get(x1, y1));
                } else {
                    planePoint1 = new Vector3D(x2, y2, this.heightProfile.get(x2, y2));
                }
                planePoint2 = new Vector3D(x2, y1, this.heightProfile.get(x2, y1));
View Full Code Here

               
//                env2D.setZoomBoxMiddle(env2D.getAgentPosition(this.markedAgentId));
                Vector2D agentPos = new Vector2D(env2D.getAgentPosition(this.markedAgentId));
                Vector2D zoomBoxPos = new Vector2D(env2D.getZoomBoxMiddle());
                       
                double distance = zoomBoxPos.distance(agentPos);

                if (this.currentFollowerSpeed < this.maxSpeed) {
                    this.currentFollowerSpeed += cameraTranslationAcceleration;
                }
               
View Full Code Here

        if (agent2D != null) {
            this.markedAgentId = agent2D.id();
        } else {
            for (AbstractAgent<?> a : agents) {
                agentPos = this.currentEnv.getPositionInVisualization(a.id());
                akt = agentPos.distance(clickPos);
                if (min > akt) {
                    markedID = a.id();
                    min = akt;
                }
            }
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.