avoid zoom-level relative calculation
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
*/
|
||||
package org.oscim.utils;
|
||||
|
||||
import org.oscim.core.Point2D;
|
||||
|
||||
import android.graphics.Point;
|
||||
|
||||
/**
|
||||
@@ -169,18 +171,13 @@ public final class GeometryUtils {
|
||||
return Math.abs((P.x - A.x) * (B.y - A.y) - (P.y - A.y) * (B.x - A.x)) / normalLength;
|
||||
}
|
||||
|
||||
public static final class Point2D {
|
||||
public double x;
|
||||
public double y;
|
||||
}
|
||||
|
||||
// from libosmscout-render
|
||||
public static byte calcLinesIntersect(
|
||||
double ax1, double ay1,
|
||||
double ax2, double ay2,
|
||||
double bx1, double by1,
|
||||
double bx2, double by2,
|
||||
GeometryUtils.Point2D point)
|
||||
Point2D point)
|
||||
{
|
||||
double ua_numr = (bx2 - bx1) * (ay1 - by1) - (by2 - by1) * (ax1 - bx1);
|
||||
double ub_numr = (ax2 - ax1) * (ay1 - by1) - (ay2 - ay1) * (ax1 - bx1);
|
||||
|
||||
Reference in New Issue
Block a user