org.nlogo.agent
Class Protractor

java.lang.Object
  extended by org.nlogo.agent.Protractor
All Implemented Interfaces:
Protractor
Direct Known Subclasses:
Protractor3D

public class Protractor
extends Object
implements Protractor


Method Summary
 double distance(Agent agent1, Agent agent2, boolean wrap)
           
 double distance(Agent agent, double x2, double y2, boolean wrap)
           
 double distance(double x1, double y1, double x2, double y2, boolean wrap)
           
 double distanceToLink(Link link, double x, double y)
           
 Patch getPatchAtHeadingAndDistance(Agent a, double heading, double distance)
           
 Patch getPatchAtHeadingAndDistance(double x, double y, double heading, double distance)
           
 boolean inBounds(double x1, double y1, double x2, double y2, double x, double y)
           
 double towards(Agent fromAgent, Agent toAgent, boolean wrap)
           
 double towards(Agent fromAgent, double toX, double toY, boolean wrap)
           
 double towards(double fromX, double fromY, double toX, double toY, boolean wrap)
           
 double towardsPitch(Agent fromAgent, Agent toAgent, boolean wrap)
           
 double towardsPitch(Agent fromAgent, double toX, double toY, double toZ, boolean wrap)
           
 double towardsPitch(double fromX, double fromY, double fromZ, double toX, double toY, double toZ, boolean wrap)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

distanceToLink

public double distanceToLink(Link link,
                             double x,
                             double y)

inBounds

public boolean inBounds(double x1,
                        double y1,
                        double x2,
                        double y2,
                        double x,
                        double y)

distance

public double distance(Agent agent,
                       double x2,
                       double y2,
                       boolean wrap)

distance

public double distance(Agent agent1,
                       Agent agent2,
                       boolean wrap)

distance

public double distance(double x1,
                       double y1,
                       double x2,
                       double y2,
                       boolean wrap)

getPatchAtHeadingAndDistance

public Patch getPatchAtHeadingAndDistance(Agent a,
                                          double heading,
                                          double distance)
                                   throws AgentException
Throws:
AgentException

getPatchAtHeadingAndDistance

public Patch getPatchAtHeadingAndDistance(double x,
                                          double y,
                                          double heading,
                                          double distance)
                                   throws AgentException
Throws:
AgentException

towards

public double towards(Agent fromAgent,
                      Agent toAgent,
                      boolean wrap)
               throws AgentException
Throws:
AgentException

towards

public double towards(Agent fromAgent,
                      double toX,
                      double toY,
                      boolean wrap)
               throws AgentException
Returns:
0 <= result < 360
Throws:
AgentException

towards

public double towards(double fromX,
                      double fromY,
                      double toX,
                      double toY,
                      boolean wrap)
               throws AgentException
Specified by:
towards in interface Protractor
Returns:
0 <= result < 360
Throws:
AgentException

towardsPitch

public double towardsPitch(Agent fromAgent,
                           Agent toAgent,
                           boolean wrap)
                    throws AgentException
Throws:
AgentException

towardsPitch

public double towardsPitch(Agent fromAgent,
                           double toX,
                           double toY,
                           double toZ,
                           boolean wrap)
                    throws AgentException
Throws:
AgentException

towardsPitch

public double towardsPitch(double fromX,
                           double fromY,
                           double fromZ,
                           double toX,
                           double toY,
                           double toZ,
                           boolean wrap)
                    throws AgentException
Specified by:
towardsPitch in interface Protractor
Throws:
AgentException