本文整理匯總了Java中org.apache.commons.math3.util.FastMath.toRadians方法的典型用法代碼示例。如果您正苦於以下問題:Java FastMath.toRadians方法的具體用法?Java FastMath.toRadians怎麽用?Java FastMath.toRadians使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.commons.math3.util.FastMath
的用法示例。
在下文中一共展示了FastMath.toRadians方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: convertFromGeoToEarthCentred
import org.apache.commons.math3.util.FastMath; //導入方法依賴的package包/類
/**
*
* @param lat
* @param lon
* @return
*/
public static double[] convertFromGeoToEarthCentred(final double lat, final double lon){
double pH=GeoUtils.getGeoidH(lon, lat);
double radLat=FastMath.toRadians(lat);
double radLon=FastMath.toRadians(lon);
// Convert from geographic coordinates to Earth centred Earth fixed coordinates
double cosLat=FastMath.cos(radLat);
double sinLat = FastMath.sin(radLat);
double cosLon =FastMath.cos(radLon);
double sinLon = FastMath.sin(radLon);
double denomTmp = FastMath.sqrt((semiMajorAxis2) *(cosLat*cosLat) + (semiMinorAxis2)*(sinLat*sinLat));
double pX = (semiMajorAxis2/denomTmp + pH) * cosLat * cosLon;
double pY = (semiMajorAxis2/denomTmp + pH) * cosLat * sinLon;
double pZ = (semiMinorAxis2/denomTmp + pH) * sinLat;
double[] pXYZ = {pX ,pY, pZ};
//double[] pXYZ = {4740162.032532615 , 787287.082659188, 4180253.542739194};
return pXYZ;
}
示例2: getIncidence
import org.apache.commons.math3.util.FastMath; //導入方法依賴的package包/類
/**
* Calculate the incidence angle
*/
public double getIncidence(int position) {
double incidenceangle = 0.0;
try{
// estimation of incidence angle based on near and range distance values
double nearincidence = FastMath.toRadians(getIncidenceNear().doubleValue());
double sataltitude=getSatelliteAltitude();
double distancerange = sataltitude * FastMath.tan(nearincidence) + position * this.getPixelsize()[0];
incidenceangle = FastMath.atan(distancerange / sataltitude);
}catch(Exception e){
logger.warn("Error calculatiing incidence angle:"+e.getMessage());
}
return incidenceangle;
}
示例3: getAmbiguityCorrection
import org.apache.commons.math3.util.FastMath; //導入方法依賴的package包/類
@Override
public int[] getAmbiguityCorrection(final int xPos,final int yPos) {
orbitInclination = FastMath.toRadians(getSatelliteOrbitInclination());
double temp, deltaAzimuth, deltaRange;
int[] output = new int[2];
try {
// already in radian
double incidenceAngle = getIncidence(xPos);
double[] lonlat=geotransform.getGeoFromPixel(xPos, yPos);
double slantRange = getSlanteRange(lonlat[1], lonlat[0]);
// double sold=getSlantRange(xPos,incidenceAngle);
double prf = getPRF(xPos,yPos);
double sampleDistAzim = getPixelsize()[1];
double sampleDistRange= getPixelsize()[0];
temp = (getRadarWaveLenght() * slantRange * prf) /
(2 * satelliteSpeed * (1 - FastMath.cos(orbitInclination) / getRevolutionsPerday()));
//azimuth and delta in number of pixels
deltaAzimuth = temp / sampleDistAzim;
deltaRange = (temp * temp) / (2 * slantRange * sampleDistRange * FastMath.sin(incidenceAngle));
output[0] = (int) FastMath.floor(deltaAzimuth);
output[1] = (int) FastMath.floor(deltaRange);
} catch (Exception ex) {
logger.error("Problem calculating the Azimuth ambiguity:"+ex.getMessage(),ex);
}
return output;
}
示例4: getAmbiguityCorrection
import org.apache.commons.math3.util.FastMath; //導入方法依賴的package包/類
@Override
public int[] getAmbiguityCorrection(final int xPos,final int yPos) {
if(satelliteSpeed==0){
satelliteSpeed = calcSatelliteSpeed();
orbitInclination = FastMath.toRadians(getSatelliteOrbitInclination());
}
double temp, deltaAzimuth, deltaRange;
int[] output = new int[2];
try {
// already in radian
double incidenceAngle = getIncidence(xPos);
double slantRange = getSlantRange(xPos,incidenceAngle);
double prf = getPRF(xPos,yPos);
double sampleDistAzim = getPixelsize()[0];
double sampleDistRange =getPixelsize()[1];
temp = (getRadarWaveLenght() * slantRange * prf) /
(2 * satelliteSpeed * (1 - FastMath.cos(orbitInclination) / getRevolutionsPerday()));
//azimuth and delta in number of pixels
deltaAzimuth = temp / sampleDistAzim;
deltaRange = (temp * temp) / (2 * slantRange * sampleDistRange * FastMath.sin(incidenceAngle));
output[0] = (int) FastMath.floor(deltaAzimuth);
output[1] = (int) FastMath.floor(deltaRange);
} catch (Exception ex) {
logger.error("Problem calculating the Azimuth ambiguity:"+ex.getMessage());
}
return output;
}
示例5: getAmbiguityCorrection
import org.apache.commons.math3.util.FastMath; //導入方法依賴的package包/類
@Override
public int[] getAmbiguityCorrection(final int xPos,final int yPos) {
if(satelliteSpeed==0){
satelliteSpeed = calcSatelliteSpeed();
orbitInclination = FastMath.toRadians(getSatelliteOrbitInclination());
}
double temp, deltaAzimuth, deltaRange;
int[] output = new int[2];
try {
// already in radian
double incidenceAngle = getIncidence(xPos);
double slantRange = getSlantRange(xPos,incidenceAngle);
double prf = getPRF(xPos,yPos);
double sampleDistAzim = getPixelsize()[0];
double sampleDistRange =getPixelsize()[1];
temp = (getRadarWaveLenght() * slantRange * prf) /
(2 * satelliteSpeed * (1 - FastMath.cos(orbitInclination) / getRevolutionsPerday()));
//azimuth and delta in number of pixels
deltaAzimuth = temp / sampleDistAzim;
deltaRange = (temp * temp) / (2 * slantRange * sampleDistRange * FastMath.sin(incidenceAngle));
output[0] = (int) FastMath.floor(deltaAzimuth);
output[1] = (int) FastMath.floor(deltaRange);
} catch (Exception ex) {
logger.error("Problem calculating the Azimuth ambiguity:"+ex.getMessage());
}
return output;
}
示例6: getAmbiguityCorrection
import org.apache.commons.math3.util.FastMath; //導入方法依賴的package包/類
@Override
public int[] getAmbiguityCorrection(final int xPos,final int yPos) {
if(satelliteSpeed==0){
satelliteSpeed = calcSatelliteSpeed();
orbitInclination = FastMath.toRadians(getSatelliteOrbitInclination());
}
double temp, deltaAzimuth, deltaRange;
int[] output = new int[2];
try {
// already in radian
double incidenceAngle = getIncidence(xPos);
double slantRange = getSlantRange(xPos,incidenceAngle);
double prf = getPRF(xPos,yPos);
double sampleDistAzim = getPixelsize()[0];
double sampleDistRange =getPixelsize()[1];
temp = (getRadarWaveLenght() * slantRange * prf) /
(2 * satelliteSpeed * (1 - FastMath.cos(orbitInclination) / getRevolutionsPerday()));
//azimuth and delta in number of pixels
deltaAzimuth = temp / sampleDistAzim;
deltaRange = (temp * temp) / (2 * slantRange * sampleDistRange * FastMath.sin(incidenceAngle));
output[0] = (int) FastMath.floor(deltaAzimuth);
output[1] = (int) FastMath.floor(deltaRange);
} catch (Exception ex) {
logger.error("Problem calculating the Azimuth ambiguity:"+ex.getMessage());
}
return output;
}
示例7: toRadians
import org.apache.commons.math3.util.FastMath; //導入方法依賴的package包/類
/** Convert degrees to radians, with error of less than 0.5 ULP
* @return instance converted into radians
*/
public DerivativeStructure toRadians() {
final DerivativeStructure ds = new DerivativeStructure(compiler);
for (int i = 0; i < ds.data.length; ++i) {
ds.data[i] = FastMath.toRadians(data[i]);
}
return ds;
}
示例8: getAmbiguityCorrection
import org.apache.commons.math3.util.FastMath; //導入方法依賴的package包/類
@Override
public int[] getAmbiguityCorrection(final int xPos,final int yPos) {
if(satelliteSpeed==0){
satelliteSpeed = calcSatelliteSpeed();
orbitInclination = FastMath.toRadians(getSatelliteOrbitInclination());
}
double temp, deltaAzimuth, deltaRange;
int[] output = new int[2];
try {
// already in radian
double incidenceAngle = getIncidence(xPos);
double slantRange = getSlantRange(xPos,incidenceAngle);
double prf = getPRF(xPos,yPos);
double sampleDistAzim = getPixelsize()[0];
double sampleDistRange =getPixelsize()[1];
temp = (getRadarWaveLenght() * slantRange * prf) /
(2 * satelliteSpeed * (1 - FastMath.cos(orbitInclination) / getRevolutionsPerday()));
//azimuth and delta in number of pixels
deltaAzimuth = temp / sampleDistAzim;
deltaRange = (temp * temp) / (2 * slantRange * sampleDistRange * FastMath.sin(incidenceAngle));
output[0] = (int) FastMath.floor(deltaAzimuth);
output[1] = (int) FastMath.floor(deltaRange);
if ((getSatellite()).equals("RADARSAT")) {
String myImageType = getType();
if (myImageType.equals("RSAT-1-SAR-SGF") || myImageType.equals("RSAT-1-SAR-SGX")) {
output[1] = 20; // This is really range displacement
}
}
} catch (Exception ex) {
logger.error("Problem calculating the Azimuth ambiguity:"+ex.getMessage());
}
return output;
}
示例9: getAmbiguityCorrection
import org.apache.commons.math3.util.FastMath; //導入方法依賴的package包/類
@Override
public int[] getAmbiguityCorrection(final int xPos,final int yPos) {
if(satelliteSpeed==0){
satelliteSpeed = calcSatelliteSpeed();
orbitInclination = FastMath.toRadians(getSatelliteOrbitInclination());
}
double temp, deltaAzimuth, deltaRange;
int[] output = new int[2];
try {
// already in radian
double incidenceAngle = getIncidence(xPos);
double slantRange = getSlantRange(xPos,incidenceAngle);
double prf = getPRF(xPos,yPos);
double sampleDistAzim = getPixelsize()[0];
double sampleDistRange =getPixelsize()[1];
temp = (getRadarWaveLenght() * slantRange * prf) /
(2 * satelliteSpeed * (1 - FastMath.cos(orbitInclination) / getRevolutionsPerday()));
//azimuth and delta in number of pixels
deltaAzimuth = temp / sampleDistAzim;
deltaRange = (temp * temp) / (2 * slantRange * sampleDistRange * FastMath.sin(incidenceAngle));
output[0] = (int) FastMath.floor(deltaAzimuth);
output[1] = (int) FastMath.floor(deltaRange);
if ((getSatellite()).equals("RADARSAT")) {
String myImageType = getType();
if (myImageType.equals("RSAT-1-SAR-SGF") || myImageType.equals("RSAT-1-SAR-SGX")) {
output[1] = 20; // This is really range displacement
}
}
} catch (Exception ex) {
logger.error("Problem calculating the Azimuth ambiguity:"+ex.getMessage());
}
return output;
}
示例10: toRadians
import org.apache.commons.math3.util.FastMath; //導入方法依賴的package包/類
/** Convert degrees to radians, with error of less than 0.5 ULP
* @return instance converted into radians
*/
public SparseGradient toRadians() {
return new SparseGradient(FastMath.toRadians(value), FastMath.toRadians(1.0), derivatives);
}