Evaluates the curve at point t.

@param vec The coordinate to get the location of a curve at t.
@param t value between 0 and 1
359046
public double curvePoint(XYZ vec, float t) {
        double tmp = 0;
        switch (vec) {
        case X:
            tmp = catmullRom(points[0], points[3], points[6], points[9], t);
            break;
        case Y:
            tmp = catmullRom(points[1], points[4], points[7], points[10], t);
            break;
        default:
            break;
        }
        return tmp;
    }
912815
void add_vector(SparseVector vec)
    {

        for (Map.Entry<Integer, Double> entry : vec.entrySet())
        {
            Double v = get(entry.getKey());
            if (v == null)
                v = 0.;
            put(entry.getKey(), v + entry.getValue());
        }
    }
440682
public Vec getTopicVec(int k)
    {
        return new ScaledVector(1.0/lambda.get(k).sum(), lambda.get(k));
    }
944943
public void getClosestPoint(Vector2f point, Vector2f result) {
		loc.set(point);
		loc.sub(start);

		float projDistance = vec.dot(loc);

		projDistance /= vec.lengthSquared();

		if (projDistance < 0) {
			result.set(start);
			return;
		}
		if (projDistance > 1) {
			result.set(end);
			return;
		}

		result.x = start.getX() + projDistance * vec.getX();
		result.y = start.getY() + projDistance * vec.getY();
	}
911266
void calculateValueAt(double x) {
		int len = points.size();
		for (int i = 1; i < len; i++) {
			Point p1 = points.get(i - 1);
			Point p2 = points.get(i);

			if (x >= p1.getX().doubleValue() && x <= p2.getX().doubleValue()) {
				// calculate the slope intercept form
				double m = (p2.getY().doubleValue() - p1.getY().doubleValue()) / (p2.getX().doubleValue() - p1.getX().doubleValue());
				double b = p1.getY().doubleValue() - m * p1.getX().doubleValue();

				double interpolated = m * x + b;

				// apply the hedge if we have one
				if(haveHedge()) {
					interpolated = getHedge().calculateValue(interpolated);
				}
				exploded.add(interpolated);
				return;
			}
		}
	}
405619
function( t ) {

		var delta = 0.0001;
		var t1 = t - delta;
		var t2 = t + delta;

		// Capping in case of danger

		if ( t1 < 0 ) t1 = 0;
		if ( t2 > 1 ) t2 = 1;

		var pt1 = this.getPoint( t1 );
		var pt2 = this.getPoint( t2 );

		var vec = pt2.clone().sub( pt1 );
		return vec.normalize();

	}
241197
function(vec) {
				var matchedVertex = -1;
				var l = this.vertices.length;
				for(var i=0;i<l;i++)
				{
					var vert = this.vertices[i];
					if(vert.equals(vec))
					{
						matchedVertex =i;
					}
				}
				return matchedVertex;

			}
91561
public static void set(MutableLongTuple t, long v)
    {
        for (int i=0; i<t.getSize(); i++)
        {
            t.set(i, v);
        }
    }
1343976
function(theta){
        return new Vec2(
            this.x*Math.cos(theta)-this.y*Math.sin(theta), 
            this.x*Math.sin(theta)+this.y*Math.cos(theta)
        );
    }
1015523
def _add_jitter(self, vec):
        
        if self.scatterchartdata.jitter == 0 or self.scatterchartdata.jitter is None:
            return vec
        return vec + np.random.rand(1, len(vec))[0] * self.scatterchartdata.jitter
1182652
public void setCurve (IQuadCurve curve) {
        setCurve(curve.x1(), curve.y1(), curve.ctrlX(), curve.ctrlY(),
                 curve.x2(), curve.y2());
    }
378482
public Vector3d hermite(Vector3dc t0, Vector3dc v1, Vector3dc t1, double t, Vector3d dest) {
        double t2 = t * t;
        double t3 = t2 * t;
        dest.x = (x + x - v1.x() - v1.x() + t1.x() + t0.x()) * t3 + (3.0 * v1.x() - 3.0 * x - t0.x() - t0.x() - t1.x()) * t2 + x * t + x;
        dest.y = (y + y - v1.y() - v1.y() + t1.y() + t0.y()) * t3 + (3.0 * v1.y() - 3.0 * y - t0.y() - t0.y() - t1.y()) * t2 + y * t + y;
        dest.z = (z + z - v1.z() - v1.z() + t1.z() + t0.z()) * t3 + (3.0 * v1.z() - 3.0 * z - t0.z() - t0.z() - t1.z()) * t2 + z * t + z;
        return dest;
    }
286905
public static void v(String s, Throwable t) {
		log(Level.FINEST, s, t);
	}
183725
public static void geometryOffSetCurve(ArrayList<LineString> list, Geometry geometry, double offset, BufferParameters bufferParameters) {
        final List curves = new OffsetCurveSetBuilder(geometry, offset, new OffsetCurveBuilder(geometry.getFactory().getPrecisionModel(), bufferParameters)).getCurves();
        final Iterator<SegmentString> iterator = curves.iterator();
        while (iterator.hasNext()) {
            list.add(geometry.getFactory().createLineString(iterator.next().getCoordinates()));
        }
    }
1344153
public void setCurve (ICubicCurve curve) {
        setCurve(curve.x1(), curve.y1(), curve.ctrlX1(), curve.ctrlY1(),
                 curve.ctrlX2(), curve.ctrlY2(), curve.x2(), curve.y2());
    }
183701
public Vector multiply(Vector vec) {
        x *= vec.x;
        y *= vec.y;
        z *= vec.z;
        return this;
    }
1083675
function(x, y, type) {
      this.p = new Vec(x, y); // position
      this.type = type;
      this.rad = 10; // default radius
      this.age = 0;
      this.cleanup_ = false;
    }