Theory: Given a segment from point A to point B, our
goal is to find a C point coordinates at a specified distance on that segment.

package calculatelinepoints; public class CalculateLinePoints { public static void main(String[] args) { // point A coordinates double a = 20.0; double b = 10.0; // point B coordinates double c = 50.0; double d = 40.0; // calculate distance between the two points double DT = Math.sqrt(Math.pow((c - a), 2) + Math.pow((d - b), 2)); double D = 20.0; // distance to point C double x; double y; double T = D / DT; // finding point C coordinate x = (1 - T) * a + T * c; y = (1 - T) * b + T * d; System.out.println("Point C coordinates:\n x: " + x + "\n y: " + y); } }http://e-blog-java.blogspot.ie/2013/03/how-to-find-point-coordinates-between.html

## {{ parent.title || parent.header.title}}

## {{ parent.tldr }}

## {{ parent.linkDescription }}

{{ parent.urlSource.name }}