Determining a straight line equation from 2 cartesian coordinates
问题 I can do this on paper easily enough but have a bit of a mental block in getting this into a language (I'd take any answer but Java probably easiest). I have two sets of points Point A (xA, yA) and Point B (xB, yB). Knowing this, and assuming that these two create a straight line graph I need to be able write a function that will give me xC given that I would know yC (and, obviously that the new point is on the same line). All help appreciated :) Kind Regards 回答1: (yB-yA)/(xB-xA) = (yC - yA)