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 double
angle
Angular coordinate in radians.EastNorth
pole
Reference point (analogous to the origin of a Cartesian coordinate system).double
radius
Radial coordinate (distance from the pole).private static long
serialVersionUID
-
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 double
computeAngle(EastNorth en, EastNorth pole)
Compute polar angle between an east/north and the pole.boolean
equals(java.lang.Object obj)
int
hashCode()
EastNorth
toEastNorth()
Converts thisPolarCoor
to anEastNorth
instance.java.lang.String
toString()
-
-
-
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 thisPolarCoor
to anEastNorth
instance.- Returns:
- a new
EastNorth
instance
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-