All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.psjava.formula.geometry.DistanceSquareBetweenPoints Maven / Gradle / Ivy

There is a newer version: 0.1.19
Show newest version
package org.psjava.formula.geometry;

import org.psjava.ds.geometry.Point2D;
import org.psjava.ds.numbersystrem.MultipliableNumberSystem;
import org.psjava.formula.Square;

public class DistanceSquareBetweenPoints {

	public static  T calc(MultipliableNumberSystem ns, Point2D p1, Point2D p2) {
		T dxSq = Square.calc(ns, ns.subtract(p1.x(), p2.x()));
		T dySq = Square.calc(ns, ns.subtract(p1.y(), p2.y()));
		return ns.add(dxSq, dySq);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy