Coordinate computePoint(const LineSegment& seg, double dist) { double dx = seg.p1.x - seg.p0.x; double dy = seg.p1.y - seg.p0.y; double len = seg.getLength(); Coordinate pt(dist * dx / len, dist * dy / len); pm.makePrecise(pt); return pt; }
void preciseCoordinateTester(const PrecisionModel& pm, double x1, double y1, double x2, double y2) { Coordinate p(x1, y1); pm.makePrecise(p); Coordinate pPrecise(x2, y2); ensure(p.equals2D(pPrecise)); }