AnyLogic
Expand
Font size
All Implemented Interfaces:
Locatable2D, java.io.Serializable, java.lang.Cloneable

public class Position
extends Point
Class representing Point structure three coordinates (x, y, z) with two angles for orientation. Used in various utility methods in the AnyLogic Engine and in some AnyLogic libraries.
For those utilities which operate in 2D space (x, y), the third (z) coordinate and vertical rotation are simply ignored
Author:
AnyLogic North America, LLC https://anylogic.com
See Also:
Serialized Form

Field Summary

Fields 
double rotation
The (horizontal) orientation, measured CW from right (east)
double verticalRotation
The vertical orientation, measured from horizontal-oriented (0) to the ground: "-Z" direction (ground) is positive, "+Z" direction (sky) is negative
Modifier and Type Field Description

Fields inherited from class com.anylogic.engine.Point

x, y, z

Constructor Summary

Constructors 
Position()
Creates new position with zero (0, 0, 0) coordinates and zero rotation angles (default orientation: horizontally to the right/east)
Position​(double x, double y, double rotation)
Creates new point with the given (x, y) coordinates and rotation.
Position​(double x, double y, double z, double rotation, double verticalRotation)
Creates new position with the given coordinates and rotations.
Position​(Point p)
Creates a position with the given coordinates.
Position​(Point p, double rotation, double verticalRotation)  
Position​(Position p)
Creates a copy of the given position
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods 
Position clone()  
Position clone​(Position out)
Fills the given output instance (if it is not null) or otherwise creates a copy of this object and returns it
double getRotation()
Returns the horizontal orientation
double getVerticalRotation()
Returns the vertical orientation
Position setLocation​(Position p)
Sets the location and rotations of this Position to the same values as in the given Position object.
Position setPosition​(double x, double y, double z, double rotation, double verticalRotation)
Sets the location and rotations of this Position to the given coordinates and rotations.
void setRotation​(double rotation)
Sets the horizontal orientation
void setVerticalRotation​(double verticalRotation)
Sets the vertical orientation
java.lang.String toString()  
Modifier and Type Method Description

Methods inherited from class com.anylogic.engine.Point

add, clone, distance, distance, distance, distance2D, distanceGIS, distanceGIS, distanceGIS, distanceGIS, distanceSq, distanceSq, distanceSq, distanceSq2D, equals, equals, equals2D, getLatitude, getLongitude, getX, getY, getZ, hashCode, setLatLon, setLocation, setLocation, setLocation, sub

Methods inherited from class java.lang.Object

getClass, notify, notifyAll, wait, wait, wait

Field Detail

rotation

public double rotation
The (horizontal) orientation, measured CW from right (east)

verticalRotation

public double verticalRotation
The vertical orientation, measured from horizontal-oriented (0) to the ground: "-Z" direction (ground) is positive, "+Z" direction (sky) is negative

Constructor Detail

Position

public Position()
Creates new position with zero (0, 0, 0) coordinates and zero rotation angles (default orientation: horizontally to the right/east)

Position

public Position​(double x,
                double y,
                double z,
                double rotation,
                double verticalRotation)
Creates new position with the given coordinates and rotations.
Parameters:
x - the x coordinate
y - the y coordinate
z - the z coordinate
rotation - the (horizontal) orientation, measured CW from right (east)
verticalRotation - the vertical orientation, measured from horizontal-oriented (0) to the ground: "-Z" direction (ground) is positive, "+Z" direction (sky) is negative

Position

public Position​(double x,
                double y,
                double rotation)
Creates new point with the given (x, y) coordinates and rotation. (z coordinate and vertical rotation are set to zero)
Parameters:
x - the x coordinate of the Position In case of GIS environment this is the latitude of the Point, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
y - the y coordinate of the Position In case of GIS environment this is the longitude of the Point, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
rotation - the (horizontal) orientation, measured CW from right (east)

Position

public Position​(Point p)
Creates a position with the given coordinates. Rotation angles are copied from p in case when it is a Position instance
Parameters:
p - the original point

Position

public Position​(Position p)
Creates a copy of the given position
Parameters:
p - the original point

Position

public Position​(Point p,
                double rotation,
                double verticalRotation)

Method Detail

setRotation

public void setRotation​(double rotation)
Sets the horizontal orientation
Parameters:
rotation - the (horizontal) orientation, measured CW from right (east)

getRotation

public double getRotation()
Returns the horizontal orientation
Returns:
the (horizontal) orientation, measured CW from right (east)

setVerticalRotation

public void setVerticalRotation​(double verticalRotation)
Sets the vertical orientation
Parameters:
verticalRotation - the vertical orientation, measured from horizontal-oriented (0) to the ground: "-Z" direction (ground) is positive, "+Z" direction (sky) is negative

getVerticalRotation

public double getVerticalRotation()
Returns the vertical orientation
Returns:
the vertical orientation, measured from horizontal-oriented (0) to the ground: "-Z" direction (ground) is positive, "+Z" direction (sky) is negative

setLocation

public Position setLocation​(Position p)
Sets the location and rotations of this Position to the same values as in the given Position object.
Parameters:
p - the specified Position to which to set this Position
Returns:
this Position object

setPosition

public Position setPosition​(double x,
                            double y,
                            double z,
                            double rotation,
                            double verticalRotation)
Sets the location and rotations of this Position to the given coordinates and rotations.
Parameters:
x - the x coordinate
y - the y coordinate
z - the z coordinate
rotation - the (horizontal) orientation, measured CW from right (east)
verticalRotation - the vertical orientation, measured from horizontal-oriented (0) to the ground: "-Z" direction (ground) is positive, "+Z" direction (sky) is negative
Returns:
this Position object

clone

public Position clone()
Overrides:
clone in class Point

clone

public Position clone​(Position out)
Fills the given output instance (if it is not null) or otherwise creates a copy of this object and returns it
Parameters:
out - the Position object to write to (may be null)
Returns:
the given output object (if was not null) or new Position with coordinates and rotations set equal to this object.

toString

public java.lang.String toString()
Overrides:
toString in class Point
How can we improve this article?