Tabnine Logo
Math.atan
Code IndexAdd Tabnine to your IDE (free)

How to use
atan
method
in
java.lang.Math

Best Java code snippets using java.lang.Math.atan (Showing top 20 results out of 8,064)

origin: jMonkeyEngine/jmonkeyengine

/**
 * Returns the arc tangent of an angle given in radians.<br>
 * @param fValue The angle, in radians.
 * @return fValue's atan
 * @see java.lang.Math#atan(double)
 */
public static float atan(float fValue) {
  return (float) Math.atan(fValue);
}
origin: apache/mahout

 @Override
 public double apply(double a) {
  return Math.atan(a);
 }
};
origin: google/ExoPlayer

 private float calculateFieldOfViewInYDirection(float aspect) {
  boolean landscapeMode = aspect > 1;
  if (landscapeMode) {
   double halfFovX = FIELD_OF_VIEW_DEGREES / 2;
   double tanY = Math.tan(Math.toRadians(halfFovX)) / aspect;
   double halfFovY = Math.toDegrees(Math.atan(tanY));
   return (float) (halfFovY * 2);
  } else {
   return FIELD_OF_VIEW_DEGREES;
  }
 }
}
origin: plantuml/plantuml

 public double inverseProjectY(double y)
 {
  return Math.sin(Math.atan(y));
 }
}
origin: plantuml/plantuml

 public double inverseProjectY(double y)
 {
  return Math.sin(2 * (Math.atan(Math.exp(y)) - Math.PI / 4));
 }
}
origin: apache/incubator-druid

 @Override
 protected ExprEval eval(double param)
 {
  return ExprEval.of(Math.atan(param));
 }
}
origin: plantuml/plantuml

  public BigDecimal eval(List<? extends Number> parameters) {
    assertNotNull(parameters.get(0));
    double d = Math.toDegrees(Math.atan(parameters.get(0).doubleValue()));
    return new BigDecimal(d, mc);
  }
});
origin: googlemaps/android-maps-utils

  public LatLng toLatLng(com.google.maps.android.geometry.Point point) {
    final double x = point.x / mWorldWidth - 0.5;
    final double lng = x * 360;

    double y = .5 - (point.y / mWorldWidth);
    final double lat = 90 - Math.toDegrees(Math.atan(Math.exp(-y * 2 * Math.PI)) * 2);

    return new LatLng(lat, lng);
  }
}
origin: plantuml/plantuml

  public BigDecimal eval(List<? extends Number> parameters) {
    assertNotNull(parameters.get(0));
    /** Formula: acot(x) = atan(1/x) */
    if (parameters.get(0).doubleValue() == 0) {
      throw new ExpressionException("Number must not be 0");
    }
    double d = Math.toDegrees(Math.atan(1 / parameters.get(0).doubleValue()));
    return new BigDecimal(d, mc);
  }
});
origin: stackoverflow.com

 Camera.Parameters p = camera.getParameters();
int zoom = p.getZoomRatios().get(p.getZoom()).intValue();
Camera.Size sz = p.getPreviewSize();
double aspect = (double) sz.width / (double) sz.height;
double thetaV = Math.toRadians(p.getVerticalViewAngle());
double thetaH = 2d * Math.atan(aspect * Math.tan(thetaV / 2));
thetaV = 2d * Math.atan(100d * Math.tan(thetaV / 2d) / zoom);
thetaH = 2d * Math.atan(100d * Math.tan(thetaH / 2d) / zoom);
origin: apache/hive

@Override
protected DoubleWritable doEvaluate(DoubleWritable a) {
 result.set(Math.atan(a.get()));
 return result;
}
origin: prestodb/presto

private static Point tileXYToLatitudeLongitude(int tileX, int tileY, int zoomLevel)
{
  long mapSize = mapSize(zoomLevel);
  double x = (clip(tileX * TILE_PIXELS, 0, mapSize) / mapSize) - 0.5;
  double y = 0.5 - (clip(tileY * TILE_PIXELS, 0, mapSize) / mapSize);
  double latitude = 90 - 360 * Math.atan(Math.exp(-y * 2 * Math.PI)) / Math.PI;
  double longitude = 360 * x;
  return new Point(longitude, latitude);
}
origin: neo4j/neo4j

public static DoubleValue atan( AnyValue in )
{
  if ( in instanceof NumberValue )
  {
    return doubleValue( Math.atan( ((NumberValue) in).doubleValue() ) );
  }
  else
  {
    throw needsNumbers( "atan()" );
  }
}
origin: prestodb/presto

@Test
public void testAtan()
{
  for (double doubleValue : DOUBLE_VALUES) {
    assertFunction("atan(" + doubleValue + ")", DOUBLE, Math.atan(doubleValue));
    assertFunction("atan(REAL '" + (float) doubleValue + "')", DOUBLE, Math.atan((float) doubleValue));
  }
  assertFunction("atan(NULL)", DOUBLE, null);
}
origin: prestodb/presto

@Description("arc tangent")
@ScalarFunction
@SqlType(StandardTypes.DOUBLE)
public static double atan(@SqlType(StandardTypes.DOUBLE) double num)
{
  return Math.atan(num);
}
origin: stackoverflow.com

 private static double zoomAngle(double degrees, int zoom) {
  double theta = Math.toRadians(degrees);
  return 2d * Math.atan(100d * Math.tan(theta / 2d) / zoom);
}

Camera.Parameters p = camera.getParameters();
int zoom = p.getZoomRatios().get(p.getZoom()).intValue();
double thetaH = zoomAngle(p.getHorizontalViewAngle(), zoom);
double thetaV = zoomAngle(p.getVerticalViewAngle(), zoom);
origin: plantuml/plantuml

public Coordinate getLocation(int pX, int pY)
{
 final Coordinate lRaw = new Coordinate(
  2 * (Math.atan(Math.exp(inverseFinalizeY(pY))) - Math.PI / 4),
  inverseFinalizeX(pX));
 return rotateReverse(lRaw.getPoint3DRads()).getCoordinate();
}
origin: pentaho/pentaho-kettle

public Value atan() throws KettleValueException {
 if ( isNull() ) {
  return this;
 }
 if ( isNumeric() ) {
  setValue( Math.atan( getNumber() ) );
 } else {
  throw new KettleValueException( "Function ATAN only works with numeric data" );
 }
 return this;
}
origin: plantuml/plantuml

public Coordinate getLocation(int pX, int pY)
{
 final Coordinate lRaw = new Coordinate(Math.atan(inverseFinalizeY(pY)),
  inverseFinalizeX(pX));
 return rotateReverse(lRaw.getPoint3DRads()).getCoordinate();
}
origin: apache/hive

@Test
public void testVectorATan() throws HiveException {
 VectorizedRowBatch b = getVectorizedRowBatchDoubleInDoubleOut();
 DoubleColumnVector resultV = (DoubleColumnVector) b.cols[1];
 b.cols[0].noNulls = true;
 VectorExpression expr = new FuncATanDoubleToDouble(0, 1);
 expr.evaluate(b);
 Assert.assertEquals(Math.atan(0.5d), resultV.vector[4]);
}
java.langMathatan

Javadoc

Returns the closest double approximation of the arc tangent of the argument within the range [-pi/2..pi/2]. The returned result is within 1 ulp (unit in the last place) of the real result.

Special cases:

  • atan(+0.0) = +0.0
  • atan(-0.0) = -0.0
  • atan(+infinity) = +pi/2
  • atan(-infinity) = -pi/2
  • atan(NaN) = NaN

Popular methods of Math

  • min
    Returns the smaller of two long values. That is, the result is the argument closer to the value of L
  • max
    Returns the greater of two long values. That is, the result is the argument closer to the value of L
  • abs
    Returns the absolute value of a long value. If the argument is not negative, the argument is returne
  • round
    Returns the closest int to the argument, with ties rounding up. Special cases: * If the argument is
  • pow
    Returns the value of the first argument raised to the power of the second argument. Special cases: *
  • sqrt
    Returns the correctly rounded positive square root of a double value. Special cases: * If the argume
  • ceil
    Returns the smallest (closest to negative infinity) double value that is greater than or equal to th
  • floor
    Returns the largest (closest to positive infinity) double value that is less than or equal to the ar
  • random
    Returns a double value with a positive sign, greater than or equal to 0.0 and less than 1.0. Returne
  • sin
    Returns the trigonometric sine of an angle. Special cases: * If the argument is NaN or an infinit
  • cos
    Returns the trigonometric cosine of an angle. Special cases: * If the argument is NaN or an infin
  • log
    Returns the natural logarithm (base e) of a doublevalue. Special cases: * If the argument is NaN
  • cos,
  • log,
  • exp,
  • toRadians,
  • atan2,
  • log10,
  • acos,
  • tan,
  • toDegrees

Popular in Java

  • Reactive rest calls using spring rest template
  • runOnUiThread (Activity)
  • compareTo (BigDecimal)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • ImageIO (javax.imageio)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Join (org.hibernate.mapping)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now