logo separator

[mkgmap-dev] What's d for? (possibly related to clipping issue?)

From Mark Burton markb at ordern.com on Fri Feb 20 00:03:59 GMT 2009

Why does the line clipper add a tiddly amount (d) in these expressions? 


		double d = 0.00001;
		if (t[0] > 0)
			ends[0] = new Coord((int) (y0 + t[0] * dy + d), (int) (x0 + t[0] * dx + d));

		if (t[1] < 1)
			ends[1] = new Coord((int)(y0 + t[1] * dy + d), (int) (x0 + t[1] * dx + d));

On a similar note, why have the non-zero DELTA here?

	public static int toMapUnit(double l) {
		double DELTA = 0.000001; // TODO check if we really mean this
		if (l > 0)
			return (int) ((l + DELTA) * (1 << 24)/360);
		else
			return (int) ((l - DELTA) * (1 << 24)/360);
	}




More information about the mkgmap-dev mailing list