Continue a line along a given direction to the margin.

@param origin Origin point
@param delta Direction vector
@return scaling factor for delta vector
778723
public double continueToMargin(double[] origin, double[] delta) {
    assert (delta.length == 2 && origin.length == 2);
    double factor = Double.POSITIVE_INFINITY;
    if(delta[0] > 0) {
      factor = Math.min(factor, (maxx - origin[0]) / delta[0]);
    }
    else if(delta[0] < 0) {
      factor = Math.min(factor, (origin[0] - minx) / -delta[0]);
    }
    if(delta[1] > 0) {
      factor = Math.min(factor, (maxy - origin[1]) / delta[1]);
    }
    else if(delta[1] < 0) {
      factor = Math.min(factor, (origin[1] - miny) / -delta[1]);
    }
    return factor;
  }
1358275
final double internalNextDouble(double origin, double bound) {
        double r = (nextLong() >>> 11) * DOUBLE_UNIT;
        if (origin < bound) {
            r = r * (bound - origin) + origin;
            if (r >= bound) // correct for rounding
                r = Double.longBitsToDouble(Double.doubleToLongBits(bound) - 1);
        }
        return r;
    }
992825
public double spread(Front front, Front referenceFront) {
    PointDistance distance = new EuclideanDistance() ;

    // STEP 1. Sort normalizedFront and normalizedParetoFront;
    front.sort(new LexicographicalPointComparator());
    referenceFront.sort(new LexicographicalPointComparator());

    // STEP 2. Compute df and dl (See specifications in Deb's description of the metric)
    double df = distance.compute(front.getPoint(0), referenceFront.getPoint(0)) ;
    double dl = distance.compute(front.getPoint(front.getNumberOfPoints() - 1),
        referenceFront.getPoint(referenceFront.getNumberOfPoints() - 1)) ;

    double mean = 0.0;
    double diversitySum = df + dl;

    int numberOfPoints = front.getNumberOfPoints() ;

    // STEP 3. Calculate the mean of distances between points i and (i - 1).
    // (the points are in lexicografical order)
    for (int i = 0; i < (numberOfPoints - 1); i++) {
      mean += distance.compute(front.getPoint(i), front.getPoint(i + 1));
    }

    mean = mean / (double) (numberOfPoints - 1);

    // STEP 4. If there are more than a single point, continue computing the
    // metric. In other case, return the worse value (1.0, see metric's description).
    if (numberOfPoints > 1) {
      for (int i = 0; i < (numberOfPoints - 1); i++) {
        diversitySum += Math.abs(distance.compute(front.getPoint(i),
            front.getPoint(i + 1)) - mean);
      }
      return diversitySum / (df + dl + (numberOfPoints - 1) * mean);
    } else {
      return 1.0;
    }
  }
703574
public final boolean inSector(Angle start, Angle end)
    {
        if (start.clockwise(end))
        {
            return !clockwise(start) && clockwise(end);
        }
        else
        {
            return clockwise(start) && !clockwise(end);
        }
    }
804850
function(map, origin, originPoint) {
			this.writeDebug('originMarker',arguments);

			if (this.settings.originMarker !== true) {
				return;
			}

			var marker,
				originImg = '';

			if (typeof origin !== 'undefined') {
				if (this.settings.originMarkerImg !== null) {
					if (this.settings.originMarkerDim === null) {
						originImg = this.markerImage(this.settings.originMarkerImg);
					}
					else {
						originImg = this.markerImage(this.settings.originMarkerImg, this.settings.originMarkerDim.width, this.settings.originMarkerDim.height);
					}
				}
				else {
					originImg = {
						url: 'https://mt.googleapis.com/vt/icon/name=icons/spotlight/spotlight-waypoint-a.png'
					};
				}

				marker = new google.maps.Marker({
					position : originPoint,
					map      : map,
					icon     : originImg,
					draggable: false
				});
			}
		}
376746
static public void direction(GrayF32 derivX , GrayF32 derivY , GrayF32 angle )
	{
		InputSanityCheck.checkSameShape(derivX,derivY);
		angle.reshape(derivX.width,derivX.height);

		if(BoofConcurrency.USE_CONCURRENT ) {
			ImplGradientToEdgeFeatures_MT.direction(derivX,derivY,angle);
		} else {
			ImplGradientToEdgeFeatures.direction(derivX,derivY,angle);
		}
	}
724676
public static final double deltaLongitude(double latitude, double distance, double bearing)
    {
        double departure = departure(latitude);
        double sin = Math.sin(Math.toRadians(bearing));
        return (sin*distance)/(60*departure);
    }
1203469
protected double getIntersection (IVector pt) {
        if (Math.abs(direction.x) > Math.abs(direction.y)) {
            double t = (pt.x() - origin.x) / direction.x;
            return (t >= 0f && origin.y + t*direction.y == pt.y()) ? t : Float.MAX_VALUE;
        } else {
            double t = (pt.y() - origin.y) / direction.y;
            return (t >= 0f && origin.x + t*direction.x == pt.x()) ? t : Float.MAX_VALUE;
        }
    }
1268082
public CmsClientProperty withOrigin(String origin) {

        CmsClientProperty property = new CmsClientProperty(this);
        property.setOrigin(origin);
        return property;
    }
846994
function(angle, origin) {
        angle *= Math.PI / 180;
        var radius = this.distanceTo(origin);
        var theta = angle + Math.atan2(this.y - origin.y, this.x - origin.x);
        this.x = origin.x + (radius * Math.cos(theta));
        this.y = origin.y + (radius * Math.sin(theta));
        this.clearBounds();
    }
613424
function setOffsetToRangeLines(baseAndStartLine, endLine) {
                const baseLine = baseAndStartLine
                for (let lineNo = baseLine + 1; lineNo <= endLine; lineNo++) {
                    const offset = offsets.get(lineNo)
                    if (offset) {
                        if (offset.baseline <= baseLine) {
                            offset.baseline = baseLine
                            offset.offset = 1
                        }
                    } else {
                        setOffsetToLine(lineNo, 1, baseLine)
                    }
                }
            }
896408
function(startPoint) {
            var orient = this.Tree().CONFIG.rootOrientation, point = {};

            if ( this.stackParentId ) { // return different end point if node is a stacked child
                if ( orient === 'NORTH' || orient === 'SOUTH' ) {
                    orient = 'WEST';
                }
                else if ( orient === 'EAST' || orient === 'WEST' ) {
                    orient = 'NORTH';
                }
            }

            // if pseudo, a virtual center is used
            if ( orient === 'NORTH' ) {
                point.x = (this.pseudo) ? this.X - this.Tree().CONFIG.subTeeSeparation/2 : this.X + this.width/2;
                point.y = (startPoint) ? this.Y + this.height : this.Y;
            }
            else if (orient === 'SOUTH') {
                point.x = (this.pseudo) ? this.X - this.Tree().CONFIG.subTeeSeparation/2 : this.X + this.width/2;
                point.y = (startPoint) ? this.Y : this.Y + this.height;
            }
            else if (orient === 'EAST') {
                point.x = (startPoint) ? this.X : this.X + this.width;
                point.y = (this.pseudo) ? this.Y - this.Tree().CONFIG.subTeeSeparation/2 : this.Y + this.height/2;
            }
            else if (orient === 'WEST') {
                point.x = (startPoint) ? this.X + this.width : this.X;
                point.y =  (this.pseudo) ? this.Y - this.Tree().CONFIG.subTeeSeparation/2 : this.Y + this.height/2;
            }
            return point;
        }
177767
public double pathLength(double delta, double... controlPoints)
    {
        if (delta < 0 || delta > 0.5)
        {
            throw new IllegalArgumentException("illegal delta");
        }
        Point2D.Double p1 = new Point2D.Double();
        Point2D.Double p2 = new Point2D.Double();
        double sum = 0;
        calc(0, p1::setLocation, controlPoints);
        for (double t=delta;t<1.0;t+=delta)
        {
            calc(t, p2::setLocation, controlPoints);
            sum += p1.distance(p2);
            p1.setLocation(p2);
        }
        calc(1.0, p2::setLocation, controlPoints);
        sum += p1.distance(p2);
        return sum;
    }
225549
def C(self):
        '''
        
        '''
        return Point(self.maxX, self.maxY, self.origin.z)
111779
public boolean isInSphere(Vector origin, double radius) {
        return (NumberConversions.square(origin.x - x) + NumberConversions.square(origin.y - y) + NumberConversions.square(origin.z - z)) <= NumberConversions.square(radius);
    }
264297
private void exteriorAreaInteriorLine_(int half_edge, int id_a) {
		if (m_matrix[MatrixPredicate.ExteriorInterior] == 1)
			return;

		int faceParentage = m_topo_graph.getHalfEdgeFaceParentage(half_edge);
		int twinFaceParentage = m_topo_graph
				.getHalfEdgeFaceParentage(m_topo_graph
						.getHalfEdgeTwin(half_edge));

		if ((faceParentage & id_a) == 0 && (twinFaceParentage & id_a) == 0)
			m_matrix[MatrixPredicate.ExteriorInterior] = 1;
	}
6336
private void setTopMargin(final int margin) {
        FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) getLayoutParams();
        layoutParams.topMargin = margin;
        setLayoutParams(layoutParams);
    }