Java classes for coordinate systems conversion
Use this class to convert coordinates systems:
Cartesian (x,y) <-> Polar (ray,angle)
Each instance defines a POINT in a PLAN, which have coordinates in both systems: Cartesian and Polar.
Constructors:
Coordinates() - no parameters
Attributes:
double mX, mY (its cartesian coordinates)
double mRay, mAngleRadians (the polar coordinates)
Methods:
setters:
setCartesian(x,y)
Defines cartesian coordinates. Automatically calculates the Polar coordinates.
setPolarRadians(r,a)
Defines polar coordinates. Automatically calculates the cartesian pair, considering a an angle in radians.
setPolarDegrees(r,a)
Defines polar coordinates. Automatically calculates the cartesian pair, considering a an angle in degrees. Ths method actually transform the angle in radians and call setPolarRadians method.
getters:
getX() returns X
getY() returns Y
getRay() returns ray
getAngleRadinans() returns angle in radians
getAngleDegrees() returns angle in degrees. Ths method actually transform the angle from radians to degrees.