Here you can find the source of computeDistanceSqr(double t, double b1, double b2, double b3, double b4, double b5, double b6)
private static double computeDistanceSqr(double t, double b1, double b2, double b3, double b4, double b5, double b6)
//package com.java2s; /**//from w w w .ja v a2s . co m * Copyright (c) 2015, by the Authors: John E Lloyd (UBC) * * This software is freely available under a 2-clause BSD license. Please see * the LICENSE file in the ArtiSynth distribution directory for details. */ public class Main { /** * Computes the numerator of d^2 for a given value of t */ private static double computeDistanceSqr(double t, double b1, double b2, double b3, double b4, double b5, double b6) { double s = 2 * t / (1 + t * t); double c = (1 - t * t) / (1 + t * t); return b1 * s * s + b2 * c * c + b3 * s * c + b4 * s + b5 * c + b6; } }