/** * 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); }
@Override public double apply(double a) { return Math.atan(a); } };
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; } } }
public double inverseProjectY(double y) { return Math.sin(Math.atan(y)); } }
public double inverseProjectY(double y) { return Math.sin(2 * (Math.atan(Math.exp(y)) - Math.PI / 4)); } }
@Override protected ExprEval eval(double param) { return ExprEval.of(Math.atan(param)); } }
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); } });
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); } }
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); } });
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);
@Override protected DoubleWritable doEvaluate(DoubleWritable a) { result.set(Math.atan(a.get())); return result; }
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); }
public static DoubleValue atan( AnyValue in ) { if ( in instanceof NumberValue ) { return doubleValue( Math.atan( ((NumberValue) in).doubleValue() ) ); } else { throw needsNumbers( "atan()" ); } }
@Description("arc tangent") @ScalarFunction @SqlType(StandardTypes.DOUBLE) public static double atan(@SqlType(StandardTypes.DOUBLE) double num) { return Math.atan(num); }
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);
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(); }
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; }
public Coordinate getLocation(int pX, int pY) { final Coordinate lRaw = new Coordinate(Math.atan(inverseFinalizeY(pY)), inverseFinalizeX(pX)); return rotateReverse(lRaw.getPoint3DRads()).getCoordinate(); }
@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]); }