当前位置: 首页>>代码示例>>Java>>正文


Java FastMath.sin方法代码示例

本文整理汇总了Java中org.apache.commons.math3.util.FastMath.sin方法的典型用法代码示例。如果您正苦于以下问题:Java FastMath.sin方法的具体用法?Java FastMath.sin怎么用?Java FastMath.sin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.math3.util.FastMath的用法示例。


在下文中一共展示了FastMath.sin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: value

import org.apache.commons.math3.util.FastMath; //导入方法依赖的package包/类
/** {@inheritDoc}
 * @since 3.1
 */
public DerivativeStructure value(final DerivativeStructure t)
    throws DimensionMismatchException {
    final double x = t.getValue();
    double[] f = new double[t.getOrder() + 1];

    final double alpha = omega * x + phase;
    f[0] = amplitude * FastMath.cos(alpha);
    if (f.length > 1) {
        f[1] = -amplitude * omega * FastMath.sin(alpha);
        final double mo2 = - omega * omega;
        for (int i = 2; i < f.length; ++i) {
            f[i] = mo2 * f[i - 2];
        }
    }

    return t.compose(f);

}
 
开发者ID:biocompibens,项目名称:SME,代码行数:22,代码来源:HarmonicOscillator.java

示例2: 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

示例3: cos

import org.apache.commons.math3.util.FastMath; //导入方法依赖的package包/类
/** Compute cosine of a derivative structure.
 * @param operand array holding the operand
 * @param operandOffset offset of the operand in its array
 * @param result array where result must be stored (for
 * cosine the result array <em>cannot</em> be the input
 * array)
 * @param resultOffset offset of the result in its array
 */
public void cos(final double[] operand, final int operandOffset,
                final double[] result, final int resultOffset) {

    // create the function value and derivatives
    double[] function = new double[1 + order];
    function[0] = FastMath.cos(operand[operandOffset]);
    if (order > 0) {
        function[1] = -FastMath.sin(operand[operandOffset]);
        for (int i = 2; i <= order; ++i) {
            function[i] = -function[i - 2];
        }
    }

    // apply function composition
    compose(operand, operandOffset, function, result, resultOffset);

}
 
开发者ID:biocompibens,项目名称:SME,代码行数:26,代码来源:DSCompiler.java

示例4: sin

import org.apache.commons.math3.util.FastMath; //导入方法依赖的package包/类
/** Compute sine of a derivative structure.
 * @param operand array holding the operand
 * @param operandOffset offset of the operand in its array
 * @param result array where result must be stored (for
 * sine the result array <em>cannot</em> be the input
 * array)
 * @param resultOffset offset of the result in its array
 */
public void sin(final double[] operand, final int operandOffset,
                final double[] result, final int resultOffset) {

    // create the function value and derivatives
    double[] function = new double[1 + order];
    function[0] = FastMath.sin(operand[operandOffset]);
    if (order > 0) {
        function[1] = FastMath.cos(operand[operandOffset]);
        for (int i = 2; i <= order; ++i) {
            function[i] = -function[i - 2];
        }
    }

    // apply function composition
    compose(operand, operandOffset, function, result, resultOffset);

}
 
开发者ID:biocompibens,项目名称:SME,代码行数:26,代码来源:DSCompiler.java

示例5: guessPhi

import org.apache.commons.math3.util.FastMath; //导入方法依赖的package包/类
/**
 * Estimate a first guess of the phase.
 *
 * @param observations Observations, sorted w.r.t. abscissa.
 * @return the guessed phase.
 */
private double guessPhi(WeightedObservedPoint[] observations) {
    // initialize the means
    double fcMean = 0;
    double fsMean = 0;

    double currentX = observations[0].getX();
    double currentY = observations[0].getY();
    for (int i = 1; i < observations.length; ++i) {
        // one step forward
        final double previousX = currentX;
        final double previousY = currentY;
        currentX = observations[i].getX();
        currentY = observations[i].getY();
        final double currentYPrime = (currentY - previousY) / (currentX - previousX);

        double omegaX = omega * currentX;
        double cosine = FastMath.cos(omegaX);
        double sine = FastMath.sin(omegaX);
        fcMean += omega * currentY * cosine - currentYPrime * sine;
        fsMean += omega * currentY * sine + currentYPrime * cosine;
    }

    return FastMath.atan2(-fsMean, fcMean);
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:31,代码来源:HarmonicFitter.java

示例6: vector

import org.apache.commons.math3.util.FastMath; //导入方法依赖的package包/类
/** Build the normalized vector corresponding to spherical coordinates.
 * @param theta azimuthal angle \( \theta \) in the x-y plane
 * @param phi polar angle \( \varphi \)
 * @return normalized vector
 * @exception OutOfRangeException if \( \varphi \) is not in the [\( 0; \pi \)] range
 */
private static Vector3D vector(final double theta, final double phi)
   throws OutOfRangeException {

    if (phi < 0 || phi > FastMath.PI) {
        throw new OutOfRangeException(phi, 0, FastMath.PI);
    }

    final double cosTheta = FastMath.cos(theta);
    final double sinTheta = FastMath.sin(theta);
    final double cosPhi   = FastMath.cos(phi);
    final double sinPhi   = FastMath.sin(phi);

    return new Vector3D(cosTheta * sinPhi, sinTheta * sinPhi, cosPhi);

}
 
开发者ID:biocompibens,项目名称:SME,代码行数:22,代码来源:S2Point.java

示例7: SphericalCoordinates

import org.apache.commons.math3.util.FastMath; //导入方法依赖的package包/类
/** Build a spherical coordinates transformer from spherical coordinates.
 * @param r radius
 * @param theta azimuthal angle in x-y plane
 * @param phi polar (co-latitude) angle
 */
public SphericalCoordinates(final double r, final double theta, final double phi) {

    final double cosTheta = FastMath.cos(theta);
    final double sinTheta = FastMath.sin(theta);
    final double cosPhi   = FastMath.cos(phi);
    final double sinPhi   = FastMath.sin(phi);

    // spherical coordinates
    this.r     = r;
    this.theta = theta;
    this.phi   = phi;

    // Cartesian coordinates
    this.v  = new Vector3D(r * cosTheta * sinPhi,
                           r * sinTheta * sinPhi,
                           r * cosPhi);

}
 
开发者ID:biocompibens,项目名称:SME,代码行数:24,代码来源:SphericalCoordinates.java

示例8: nextGaussian

import org.apache.commons.math3.util.FastMath; //导入方法依赖的package包/类
/** {@inheritDoc} */
public double nextGaussian() {

    final double random;
    if (Double.isNaN(nextGaussian)) {
        // generate a new pair of gaussian numbers
        final double x = nextDouble();
        final double y = nextDouble();
        final double alpha = 2 * FastMath.PI * x;
        final double r      = FastMath.sqrt(-2 * FastMath.log(y));
        random       = r * FastMath.cos(alpha);
        nextGaussian = r * FastMath.sin(alpha);
    } else {
        // use the second element of the pair already generated
        random = nextGaussian;
        nextGaussian = Double.NaN;
    }

    return random;

}
 
开发者ID:biocompibens,项目名称:SME,代码行数:22,代码来源:BitsStreamGenerator.java

示例9: gradient

import org.apache.commons.math3.util.FastMath; //导入方法依赖的package包/类
/**
 * Computes the value of the gradient at {@code x}.
 * The components of the gradient vector are the partial
 * derivatives of the function with respect to each of the
 * <em>parameters</em> (amplitude, angular frequency and phase).
 *
 * @param x Value at which the gradient must be computed.
 * @param param Values of amplitude, angular frequency and phase.
 * @return the gradient vector at {@code x}.
 * @throws NullArgumentException if {@code param} is {@code null}.
 * @throws DimensionMismatchException if the size of {@code param} is
 * not 3.
 */
public double[] gradient(double x, double ... param)
    throws NullArgumentException,
           DimensionMismatchException {
    validateParameters(param);

    final double amplitude = param[0];
    final double omega = param[1];
    final double phase = param[2];

    final double xTimesOmegaPlusPhase = omega * x + phase;
    final double a = HarmonicOscillator.value(xTimesOmegaPlusPhase, 1);
    final double p = -amplitude * FastMath.sin(xTimesOmegaPlusPhase);
    final double w = p * x;

    return new double[] { a, w, p };
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:30,代码来源:HarmonicOscillator.java

示例10: 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

示例11: 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

示例12: getAmbiguityCorrection

import org.apache.commons.math3.util.FastMath; //导入方法依赖的package包/类
@Override
  public int[] getAmbiguityCorrection(final int xPos,final int yPos) {
  	float prf=0;
  	if(isScanSar())
  		prf=NOMINAL_PRF; //Nominal PRF
else
	try {
		prf=prop.getPrf();
	} catch (Exception e) {
		logger.warn("Error reading PRF",e);
		prf=0;
	}
  	
   satelliteSpeed = calcSatelliteSpeed();

      double temp, deltaAzimuth, deltaRange;
      int[] output = new int[2];

      try {
      	// already in radian
          double incidenceAngle = getIncidence(xPos);
          double slantRange = ((CeosAlosProperties)prop).getSlantRange();

          double sampleDistAzim = getPixelsize()[0];
          double sampleDistRange =getPixelsize()[1];

          temp = (((CeosAlosProperties)prop).getWaveLength() * slantRange * prf) /
                  (2 * satelliteSpeed * (1 - FastMath.cos(ORBIT_INCLINATION) / REV_PER_DAY));

          //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,代码行数:41,代码来源:GDALAlosCeos.java

示例13: 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

示例14: 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

示例15: setRotationAngle

import org.apache.commons.math3.util.FastMath; //导入方法依赖的package包/类
/**
 * Sets the rotation angle.
 */
public void setRotationAngle(double angle)
{
    rotation = angle;
    sin_rotation = FastMath.sin(angle * DEGTORAD);
    cos_rotation = FastMath.cos(angle * DEGTORAD);
    sx_cos = -scale_x * cos_rotation;
    sx_sin = -scale_x * sin_rotation;
    sy_cos = -scale_y * cos_rotation;
    sy_sin = scale_y * sin_rotation;
}
 
开发者ID:mkulesh,项目名称:microMathematics,代码行数:14,代码来源:SurfacePlotProjector.java


注:本文中的org.apache.commons.math3.util.FastMath.sin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。