Lines Matching refs:x2

75         public float x2;
95 * @param x2 the X coordinate of the end point
99 public Float(float x1, float y1, float x2, float y2) {
100 setLine(x1, y1, x2, y2);
143 return (double) x2;
159 return new Point2D.Float(x2, y2);
166 public void setLine(double x1, double y1, double x2, double y2) {
169 this.x2 = (float) x2;
178 * @param x2 the X coordinate of the end point
182 public void setLine(float x1, float y1, float x2, float y2) {
185 this.x2 = x2;
195 if (x1 < x2) {
197 w = x2 - x1;
199 x = x2;
200 w = x1 - x2;
242 public double x2;
263 * @param x2 the X coordinate of the end point
267 public Double(double x1, double y1, double x2, double y2) {
268 setLine(x1, y1, x2, y2);
311 return x2;
327 return new Point2D.Double(x2, y2);
334 public void setLine(double x1, double y1, double x2, double y2) {
337 this.x2 = x2;
347 if (x1 < x2) {
349 w = x2 - x1;
351 x = x2;
352 w = x1 - x2;
435 * @param x2 the X coordinate of the end point
439 public abstract void setLine(double x1, double y1, double x2, double y2);
465 * {@code (x1,y1)} to {@code (x2,y2)}.
485 * "beyond {@code (x2,y2)}".
491 * @param x2 the X coordinate of the end point of the
505 double x2, double y2,
508 x2 -= x1;
512 double ccw = px * y2 - py * x2;
520 ccw = px * x2 + py * y2;
522 // Reverse the projection to be relative to the original x2,y2
523 // x2 and y2 are simply negated.
524 // px and py need to have (x2 - x1) or (y2 - y1) subtracted
527 // point is "beyond (x2,y2)", then we want to calculate
528 // the inverse anyway - thus we leave x2 & y2 negated.
529 px -= x2;
531 ccw = px * x2 + py * y2;
579 * {@code (x2,y2)} intersects the line segment from {@code (x3,y3)}
586 * @param x2 the X coordinate of the end point of the first
604 double x2, double y2,
608 return ((relativeCCW(x1, y1, x2, y2, x3, y3) *
609 relativeCCW(x1, y1, x2, y2, x4, y4) <= 0)
611 relativeCCW(x3, y3, x4, y4, x2, y2) <= 0));
616 * {@code (x2,y2)} intersects this line segment.
622 * @param x2 the X coordinate of the end point of the
630 public boolean intersectsLine(double x1, double y1, double x2, double y2) {
631 return linesIntersect(x1, y1, x2, y2,
659 * @param x2 the X coordinate of the end point of the
673 double x2, double y2,
677 // x2,y2 becomes relative vector from x1,y1 to end of segment
678 x2 -= x1;
683 double dotprod = px * x2 + py * y2;
686 // px,py is on the side of x1,y1 away from x2,y2
691 // switch to backwards vectors relative to x2,y2
692 // x2,y2 are already the negative of x1,y1=>x2,y2
693 // to get px,py to be the negative of px,py=>x2,y2
696 px = x2 - px;
698 dotprod = px * x2 + py * y2;
700 // px,py is on the side of x2,y2 away from x1,y1
705 // px,py is between x1,y1 and x2,y2
707 // projected on the x2,y2=>x1,y1 vector times the
708 // length of the x2,y2=>x1,y1 vector
709 projlenSq = dotprod * dotprod / (x2 * x2 + y2 * y2);
734 * @param x2 the X coordinate of the end point of the
748 double x2, double y2,
751 return Math.sqrt(ptSegDistSq(x1, y1, x2, y2, px, py));
843 * @param x2 the X coordinate of the end point of the specified line
855 double x2, double y2,
859 // x2,y2 becomes relative vector from x1,y1 to end of segment
860 x2 -= x1;
865 double dotprod = px * x2 + py * y2;
867 // projected on the x1,y1=>x2,y2 vector times the
868 // length of the x1,y1=>x2,y2 vector
869 double projlenSq = dotprod * dotprod / (x2 * x2 + y2 * y2);
888 * @param x2 the X coordinate of the end point of the specified line
900 double x2, double y2,
903 return Math.sqrt(ptLineDistSq(x1, y1, x2, y2, px, py));