Package org.openstreetmap.josm.data.coor
Class PolarCoor
- java.lang.Object
-
- org.openstreetmap.josm.data.coor.PolarCoor
-
- All Implemented Interfaces:
java.io.Serializable
public class PolarCoor extends java.lang.Object implements java.io.Serializable
Polar coordinate.- Since:
- 13107 (extracted from
AlignInCircleAction) - See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description doubleangleAngular coordinate in radians.EastNorthpoleReference point (analogous to the origin of a Cartesian coordinate system).doubleradiusRadial coordinate (distance from the pole).private static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description PolarCoor(double radius, double angle)Constructs a newPolarCoor, using(0,0)as pole.PolarCoor(double radius, double angle, EastNorth pole)Constructs a newPolarCoor.PolarCoor(EastNorth en)PolarCoor(EastNorth en, EastNorth pole)Constructs a newPolarCoor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static doublecomputeAngle(EastNorth en, EastNorth pole)Compute polar angle between an east/north and the pole.booleanequals(java.lang.Object obj)inthashCode()EastNorthtoEastNorth()Converts thisPolarCoorto anEastNorthinstance.java.lang.StringtoString()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
radius
public final double radius
Radial coordinate (distance from the pole).
-
angle
public final double angle
Angular coordinate in radians.
-
-
Constructor Detail
-
PolarCoor
public PolarCoor(double radius, double angle)
Constructs a newPolarCoor, using(0,0)as pole.- Parameters:
radius- radial coordinate (distance from the pole)angle- angular coordinate in radians
-
PolarCoor
public PolarCoor(double radius, double angle, EastNorth pole)
Constructs a newPolarCoor.- Parameters:
radius- radial coordinate (distance from the pole)angle- angular coordinate in radianspole- reference point (analogous to the origin of a Cartesian coordinate system)
-
-
Method Detail
-
computeAngle
public static double computeAngle(EastNorth en, EastNorth pole)
Compute polar angle between an east/north and the pole.- Parameters:
en- east/north coordinatespole- reference point (analogous to the origin of a Cartesian coordinate system)- Returns:
- polar angle in radians
-
toEastNorth
public EastNorth toEastNorth()
Converts thisPolarCoorto anEastNorthinstance.- Returns:
- a new
EastNorthinstance
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-