當前位置: 首頁>>代碼示例>>Java>>正文


Java FastMath.toRadians方法代碼示例

本文整理匯總了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;
}
 
開發者ID:ec-europa,項目名稱:sumo,代碼行數:29,代碼來源:GeoUtils.java

示例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;
}
 
開發者ID:ec-europa,項目名稱:sumo,代碼行數:19,代碼來源:SarImageReader.java

示例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;
}
 
開發者ID:ec-europa,項目名稱:sumo,代碼行數:34,代碼來源:Sentinel1.java

示例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;
}
 
開發者ID:ec-europa,項目名稱:sumo,代碼行數:35,代碼來源:EnvisatImage.java

示例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;
}
 
開發者ID:ec-europa,項目名稱:sumo,代碼行數:36,代碼來源:AbstractCosmoSkymedImage.java

示例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;
}
 
開發者ID:ec-europa,項目名稱:sumo,代碼行數:35,代碼來源:TerrasarXImage.java

示例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;
}
 
開發者ID:biocompibens,項目名稱:SME,代碼行數:11,代碼來源:DerivativeStructure.java

示例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;
}
 
開發者ID:ec-europa,項目名稱:sumo,代碼行數:43,代碼來源:Radarsat2Image.java

示例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;
}
 
開發者ID:ec-europa,項目名稱:sumo,代碼行數:44,代碼來源:Radarsat1Image.java

示例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);
}
 
開發者ID:biocompibens,項目名稱:SME,代碼行數:7,代碼來源:SparseGradient.java


注:本文中的org.apache.commons.math3.util.FastMath.toRadians方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。