public Vector2D tangent(double t) { // format between min and max admissible values t = min(max(0, t), abs(angleExtent)); // compute tangent vector depending on position if (angleExtent < 0) { // need to invert vector for indirect arcs return ellipse.tangent(startAngle - t).times(-1); } else { return ellipse.tangent(startAngle + t); } }