Here you can find the source of calculateDistancePointToShowerAxis(double cogx, double cogy, double delta, double x, double y)
public static double calculateDistancePointToShowerAxis(double cogx, double cogy, double delta, double x, double y)
//package com.java2s; //License from project: Open Source License public class Main { public static double calculateDistancePointToShowerAxis(double cogx, double cogy, double delta, double x, double y) { double distance = 0; double r0 = (x - cogx) * Math.cos(delta) + (y - cogy) * Math.sin(delta); distance = Math/*from w w w.j a v a 2 s.c om*/ .sqrt(Math.pow(cogx - x + r0 * Math.cos(delta), 2) + Math.pow(cogy - y + r0 * Math.sin(delta), 2)); return distance; } }