📄 positiondegrees.java
字号:
package com.libGPS4j2me;
/**
* Class used to store degrees, usually latitude or longitude.
*/
public class PositionDegrees {
protected double value;
public PositionDegrees(double v) {
value = v;
}
/**
* Returns the degrees part of this object, when converted to coordinates.
*/
public int getDegrees() {
return (int) value;
}
/**
* Converts the degrees to Radians.
*/
public PositionRadians convertToRadians() {
return new PositionRadians(( value * Math.PI ) / 180.0d);
}
/**
* Returns the minutes part of this object, when converted to coordinates.
*/
public double getMinutes() {
double v = value;
v -= getDegrees();
return 60 * v; // 60 minutes in one degree.
}
public String toString() {
return String.valueOf(getDegrees()) + "\' " + String.valueOf((int)getMinutes()) + "\"";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -