Here you can find the source of kmToRtheta(final double x, final double y)
Parameter | Description |
---|---|
x | km east of the radar |
y | km north of the radar |
public static double[] kmToRtheta(final double x, final double y)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w w w .j ava2s. c om*/ * Converts km from radar to range/heading * * @param x km east of the radar * @param y km north of the radar * @return [range (in m), azimuth (in degrees)] */ public static double[] kmToRtheta(final double x, final double y) { double range = 1e3 * Math.sqrt(x * x + y * y); double azimuth = 90 - Math.toDegrees(Math.PI / 2 - Math.atan2(x, y)); if (azimuth < 0) azimuth += 360; return new double[] { range, azimuth }; } }