R1 will cause division by zero problems if only Y differs between the two points.
@Wolstan Dixie: This problem sounds like you are trying to do path plotting, so (me being curious) what do you need this algorithm for? As there might already be solutions like LSynth for it out there.
@Wolstan Dixie: This problem sounds like you are trying to do path plotting, so (me being curious) what do you need this algorithm for? As there might already be solutions like LSynth for it out there.