* @param nex Next point
* @param scale Scaling factor
*/
private void drawArc(SVGPath path, Vector cent, Vector pre, Vector nex, Vector oPrev, Vector oNext, double scale) {
// Delta vectors
final Vector rPrev = pre.minus(cent);
final Vector rNext = nex.minus(cent);
final Vector rPrNe = pre.minus(nex);
// Scaled fix points
final Vector sPrev = cent.plusTimes(rPrev, scale);
final Vector sNext = cent.plusTimes(rNext, scale);
// Orthogonal vectors to the relative vectors
// final Vector oPrev = new Vector(rPrev.get(1), -rPrev.get(0));
// final Vector oNext = new Vector(-rNext.get(1), rNext.get(0));
// Compute the intersection of rPrev+tp*oPrev and rNext+tn*oNext
// rPrNe == rPrev - rNext
final double zp = rPrNe.get(0) * oNext.get(1) - rPrNe.get(1) * oNext.get(0);
final double zn = rPrNe.get(0) * oPrev.get(1) - rPrNe.get(1) * oPrev.get(0);
final double n = oPrev.get(1) * oNext.get(0) - oPrev.get(0) * oNext.get(1);
if(n == 0) {
LoggingUtil.warning("Parallel?!?");
path.drawTo(sNext.get(0), sNext.get(1));
return;
}
final double tp = Math.abs(zp / n);
final double tn = Math.abs(zn / n);
// LoggingUtil.warning("tp: "+tp+" tn: "+tn);
// Guide points
final Vector gPrev = sPrev.plusTimes(oPrev, KAPPA * scale * tp);
final Vector gNext = sNext.minusTimes(oNext, KAPPA * scale * tn);
if(!path.isStarted()) {
path.moveTo(sPrev);
}
// path.drawTo(sPrev);