spline

Incrementally display three.js TubeGeometry

♀尐吖头ヾ 提交于 2019-12-17 19:25:05
问题 I am able to display a THREE.TubeGeometry figure as follows Code below, link to jsbin <html> <body> <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r75/three.js"></script> <script> // global variables var renderer; var scene; var camera; var geometry; var control; var count = 0; var animationTracker; init(); drawSpline(); function init() { // create a scene, that will hold all our elements such as objects, cameras and lights. scene = new THREE.Scene(); // create a camera, which

Three.JS Object following a spline path - rotation / tanget issues & constant speed issue

随声附和 提交于 2019-12-17 18:31:57
问题 I think my issue is similar to: Orient object's rotation to a spline point tangent in THREE.JS but I can't access the jsfiddle's properly and I struggled with the second part of the explanation. Basically, I have created this jsfiddle: http://jsfiddle.net/jayfield1979/qGPTT/2/ which demonstrates a simple cube following the path created by a spline using SplineCurve3 . Use standard TrackBall mouse interaction to navigate. Positioning the cube along the path is simple. However I have two

mgcv: How to set number and / or locations of knots for splines

 ̄綄美尐妖づ 提交于 2019-12-17 18:29:48
问题 I want to use function gam in mgcv packages: x <- seq(0,60, len =600) y <- seq(0,1, len=600) prova <- gam(y ~ s(x, bs='cr') can I set the number of knots in s() ? and then can I know where are the knots that the spline used? Thanks! 回答1: It is always disappointing to see a wrong answer... While setting k is the correct way to go, fx = TRUE is definitely not right: it will force using pure regression spline without penalization. locations of knots For penalized regression spline, the exact

Smooth spline representation of an arbitrary contour, f(length) --> x,y

纵然是瞬间 提交于 2019-12-17 15:35:46
问题 Suppose I have a set of x,y coordinates that mark points along contour. Is there a way that I can build a spline representation of the contour that I can evaluate at a particular position along its length and recover interpolated x,y coordinates? It is often not the case that there is a 1:1 correspondence between X and Y values, so univariate splines are no good to me. Bivariate splines would be fine, but as far as I can tell all of the functions for evaluating bivariate splines in scipy

How to fit a smooth hysteresis in a poorly distributed data set?

萝らか妹 提交于 2019-12-14 02:46:02
问题 This is a follow up question to How can I fit a smooth hysteresis in R?. A straightforward application of smooth.spline fits my actual poorly, although it proved a useful generic idea for this type of problem and had worked well on my simulated toy dataset. I uploaded an example of my dataset here. Following image is created by the code at the end. Thysteresis is not fully closed - but that's not an issue. Applying smooth.spline produces a way too messy output (red). Using argument spar in

b-splines for drawing, not predicting, based on control path

坚强是说给别人听的谎言 提交于 2019-12-14 01:58:47
问题 I've tried to approach my general problem through two separate questions here on SO: Specify clamped knot vector in bs-call and Fit a B spline to a control path. The responses to these have led me to a reformulation of the bigger problem, which I'm now posting. What I'm trying to accomplish is (in R), given a set of (non-monotonous) control points, how do I draw a b-spline along the path given by the control points. The b-spline must be clamped in both ends. This is purely for graphical

How to insure spline goes through points

时光怂恿深爱的人放手 提交于 2019-12-13 21:19:30
问题 I am trying to make a spline to compute the derivative of a contour of a part of an image. The catch is that I don't seem to know how to make the spline go through a certain point. I am using the scipy.interpolate library with the UnivariateSpline method. 回答1: For UnivariateSpline use s=0 to force interpolation: UnivariateSpline(x, y, s=0) . Or use InterpolatedUnivariateSpline , which is exactly equivalent. 回答2: I suppose that your 'contour' can be arbitrary curve not necessarily a graph of a

THREE.js: Why is my object flipping whilst travelling along a spline?

风格不统一 提交于 2019-12-13 12:52:35
问题 Following up from my original post Three.JS Object following a spline path - rotation / tangent issues & constant speed issue, I am still having the issue that the object flips at certain points along the path. View this happening on this fiddle: http://jsfiddle.net/jayfield1979/T2t59/7/ function moveBox() { if (counter <= 1) { box.position.x = spline.getPointAt(counter).x; box.position.y = spline.getPointAt(counter).y; tangent = spline.getTangentAt(counter).normalize(); axis.cross(up,

Adding Dynamic Data Series to High charts

旧巷老猫 提交于 2019-12-13 03:55:01
问题 ×212414 ×123754 I am calling a PageMethod in codebehind.aspx.cs file which returns me a string array[] in the javascript code in the aspx page the problem at hand is that string array returns Time(X axis-Value),Data/Name(Y axis Value),Type(Defines the type of chart (Spline or Column)) from a WEB SERVICE. I am using that data to add series dynamically to the chart. Using the function chart.AddSeries() but I am unable to do so. Can anyone please guide me how to do that and upon doing that I

Matlab Spline Interpolation Find X from Y

女生的网名这么多〃 提交于 2019-12-12 18:14:43
问题 I need to find the value of x when y = 0. This is my code: x=[2,3,4,5,6]; y=[10,8,4,1,-2]; xi=linspace(2,6,100); yi=interp1(x,y,xi,'spline'); plot(x,y,'o',xi,yi,'-') xlabel('x') ylabel('y') title('Data') I tried using fzero, but I couldn't figure out the proper syntax. I do not have a function f(x) to use, only the points given. 回答1: A couple of things to note: 'spline' refers to cubic spline. Be absolutely certain that is the interpolation technique that you want. Rerun your code with xi