Point2D

@param {number} x
@param {number} y
@returns {module:kld-affine.Point2D}
168513
function Point2D(x, y) {
    _classCallCheck(this, Point2D);

    this.x = x !== undefined ? x : 0.0;
    this.y = y !== undefined ? y : 0.0;
  }
1108314
function pnpoly (x,y,coords) {
    var vert = [ [0,0] ]

    for (var i = 0; i < coords.length; i++) {
      for (var j = 0; j < coords[i].length; j++) {
        vert.push(coords[i][j])
      }
      vert.push([0,0])
    }

    var inside = false
    for (var i = 0, j = vert.length - 1; i < vert.length; j = i++) {
      if (((vert[i][0] > y) != (vert[j][0] > y)) && (x < (vert[j][1] - vert[i][1]) * (y - vert[i][0]) / (vert[j][0] - vert[i][0]) + vert[i][1])) inside = !inside
    }

    return inside
  }
1291164
def transform_point(self, x, y):
        
        xy = ffi.new('double[2]', [x, y])
        cairo.cairo_matrix_transform_point(self._pointer, xy + 0, xy + 1)
        return tuple(xy)
1252490
function create2(x, y) {
    if (typeof x === "undefined") throw new Error("At least one argument must be provided.");
    if (typeof y === "undefined") y = x;
    return new Vector([x, y]);
}
1130484
function pointAt( fn, t, pos, size ) {
  var v = (fn == Shaping.step) ? Shaping.step( Shaping.quadraticOut, 6, t, size.y) : fn( t, size.y );
  return new Point( pos.x + t*size.x, pos.y + v )
}
961518
function(x, y) {
            var m0 = this.m[0],
                m1 = this.m[1],
                m2 = this.m[2],
                m3 = this.m[3],
                m4 = this.m[4],
                m5 = this.m[5],
                yt = ((m0 * (y - m5)) - (m1 * (x - m4))) / ((m0 * m3) - (m1 * m2)),
                xt = (x - m4 - (m2 * yt)) / m0;

            return this.translate(xt, yt);
        }
1155807
function(p, t) {

            var x = this.x;
            var y = this.y;
            return new Point((1 - t) * x + t * p.x, (1 - t) * y + t * p.y);
        }
77022
function idx2pos(idx, prelen, linelen) {
  prelen  = prelen || 0;
  linelen = linelen || 50;
  idx = Number(idx);
  return Math.max(0, idx - prelen - Math.floor((idx - prelen)/(linelen + 1))) + 1;
}
142872
@Pure
	public static Point2d L93_EL2(double x, double y) {
		final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
				LAMBERT_93_N,
				LAMBERT_93_C,
				LAMBERT_93_XS,
				LAMBERT_93_YS);
		return NTFLambdaPhi_NTFLambert(
				ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
				LAMBERT_2E_N,
				LAMBERT_2E_C,
				LAMBERT_2E_XS,
				LAMBERT_2E_YS);
	}
234140
public int addPoint(double x, double y) {
		int pointIndex;

		if (this.pointCoordinates == null) {
			this.pointCoordinates = new double[] {x, y};
			this.partIndexes = null;
			pointIndex = 0;
		} else {
			double[] pts = new double[this.pointCoordinates.length + 2];
			System.arraycopy(this.pointCoordinates, 0, pts, 0, this.pointCoordinates.length);
			pointIndex = pts.length - 2;
			pts[pointIndex] = x;
			pts[pointIndex + 1] = y;
			this.pointCoordinates = pts;
			pts = null;

			pointIndex /= 2;
		}

		fireShapeChanged();
		fireElementChanged();

		return pointIndex;
	}
1306634
public Member add(Number x, Number y) {
		return add(new Point(x, y));
	}
365646
function( pointA, pointB ) {

	        return { x: pointB.x - pointA.x, y: -( pointB.y - pointA.y ) };
	    }
590935
function(x, y, opt) {

        var position = {};

        var localOpt = opt || {};
        if (opt) position.args = opt;

        var isDistanceRelative = !localOpt.absoluteDistance; // relative by default
        var isDistanceAbsoluteReverse = (localOpt.absoluteDistance && localOpt.reverseDistance); // non-reverse by default
        var isOffsetAbsolute = localOpt.absoluteOffset; // offset is non-absolute by default

        var path = this.path;
        var pathOpt = { segmentSubdivisions: this.getConnectionSubdivisions() };

        var labelPoint = new g.Point(x, y);
        var t = path.closestPointT(labelPoint, pathOpt);

        // GET DISTANCE:

        var labelDistance = path.lengthAtT(t, pathOpt);
        if (isDistanceRelative) labelDistance = (labelDistance / this.getConnectionLength()) || 0; // fix to prevent NaN for 0 length
        if (isDistanceAbsoluteReverse) labelDistance = (-1 * (this.getConnectionLength() - labelDistance)) || 1; // fix for end point (-0 => 1)

        position.distance = labelDistance;

        // GET OFFSET:
        // use absolute offset if:
        // - opt.absoluteOffset is true,
        // - opt.absoluteOffset is not true but there is no tangent

        var tangent;
        if (!isOffsetAbsolute) tangent = path.tangentAtT(t);

        var labelOffset;
        if (tangent) {
            labelOffset = tangent.pointOffset(labelPoint);

        } else {
            var closestPoint = path.pointAtT(t);
            var labelOffsetDiff = labelPoint.difference(closestPoint);
            labelOffset = { x: labelOffsetDiff.x, y: labelOffsetDiff.y };
        }

        position.offset = labelOffset;

        return position;
    }
1068663
function (x, y) {
            if (this.indices.length === 0) {
                var points = this.points;
                var data = [];

                // flatten the points vector array
                for (var i = 0; i < points.length; i++) {
                    // XXX Optimize me
                    data.push(points[i].x);
                    data.push(points[i].y);
                }
                this.indices = earcut(data);
            }
            return this.indices;
        }
532680
public double Function2D(double x, double y) {
        return Math.exp(-(x * x + y * y) / (2 * sqrSigma)) / (2 * Math.PI * sqrSigma);
    }
954642
@Pure
	public static Point2d L2_L3(double x, double y) {
		final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
				LAMBERT_2_N,
				LAMBERT_2_C,
				LAMBERT_2_XS,
				LAMBERT_2_YS);
		return NTFLambdaPhi_NTFLambert(
				ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
				LAMBERT_3_N,
				LAMBERT_3_C,
				LAMBERT_3_XS,
				LAMBERT_3_YS);
	}
61018
@Pure
	public static Point2d EL2_L3(double x, double y) {
		final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
				LAMBERT_2E_N,
				LAMBERT_2E_C,
				LAMBERT_2E_XS,
				LAMBERT_2E_YS);
		return NTFLambdaPhi_NTFLambert(
				ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
				LAMBERT_3_N,
				LAMBERT_3_C,
				LAMBERT_3_XS,
				LAMBERT_3_YS);
	}