spline

Calculate a bezier spline to get from point to point

I have 2 points in X,Y + Rotation and I need to calculate a bezier spline (a collection of quadratic beziers) that connects these 2 points smoothly. (see pic) The point represents a unit in a game which can only rotate slowly. So to get from point A to B, it has to take a long path. The attached picture shows quite an exaggeratedly curv...

How can you draw a bezier curve given four points with wxPython?

It appears to me that the DC's only support for curves of any sort is with splines. Are there any libraries that add bezier functionality, or is there a way to convert a bezier curve into a spline? ...

Python Least-Squares Natural Splines

I am trying to find a numerical package which will fit a natural spline which minimizes weighted least squares. There is a package in scipy which does what I want for unnatural splines. import numpy as np import matplotlib.pyplot as plt from scipy import interpolate, randn x = np.arange(0,5,1.0/6) xs = np.arange(0,5,1.0/500) y = np....

Closest point on a cubic Bezier curve?

How can I find the point B(t) along a cubic Bezier curve that is closest to an arbitrary point P in the plane? ...

Create a circle using a Catmull-Rom Spline

I have a class where you enter control points for a catmull-rom spline, and then it returns a list of points running along the spline. What points would I need to enter to create a circle? ...

(kind of) rotating and slicing elements of a container in C++

Hi, I have a std::vector that holds a Point struct (x,y,z and some other non-pointer types). These points are control points for drawing a bspline curve. I'm not having trouble drawing the curve, but complications arise when I have to close the curve, which involves adding control points (alredy existing inside the container) in certai...

Math: Ease In, ease Out a displacement using Hermite curve with time constraint

Hi, I'm trying to write a method that interpolates from 0 to x (position of an object in one dimension) over time using acceleration at the beginning and deceleration at the end (ease out / ease in) with the only constraints that the total time is provided, as well as the duration of the acceleration and deceleration. the motion should r...

Akima interpolation of an array of doubles

Assuming I have an array of doubles, what's a good algorithm to sample this series using Akima interpolation? I'm too stupid to translate that mathematical description into code. // values is an array of doubles // idx is the index of the left-hand value for the current interpolation // t is the normalized parameter between values[idx] ...

Surface Reconstruction from Contours with Quick Rescaling

I'm looking to construct a 3-D surface of a part of the brain based on 2-D contours from cross-sectional slices from multiple angles. Once I get this shape, I want to "fit" it to another set of contours via rescaling. I'm aspiring to do this in the context of an MCMC analysis, so it would be very nice if I could easily compute the volum...

How to create a cubic bezier curve when given N points in 3D?

So I need to find out where the control points would be for a cubic bezier curve when only knowing points on the curve, the points can lie in 3D. It would be ideal if I could do this for any number of points on the curve. Most of what I have found deals only with 2D, or only for 4 points. ...

How do I draw a vermiculated line in Java?

I know how to draw straight lines but could I draw a line which http://img163.imageshack.us/img163/2320/path3003.png (around a straight line i.e.)? Excuse me, I do not speak English very well to describe this more detailed ;-) Edit: Hey sorry for my late answer - you are right, it should be something like a sine wave which "vericulates...

Finding points on a bezier curve based on distance from another point.

So I have a 3D cubic bezier curve and a start point found anywhere along the curve and need to find a second point further down the curve that is a specific worldspace distance (not arclength distance) away from the first point. Another issue would be if the second point reached the end of the curve and still wasn't at the desired world...

Smooth Path traversing in C#

Hello. I'm looking for a C# implementation of a Spline, not to draw it, but to traverse it. Basically I have a 2D game and I want an object to move on a predefined path. Any ideas how to implement this ? Thanks, SW ...

Cubic Spline class for Obj C or C?

I need to use natural cubic spline interpolation in an iPhone app. Does anyone know of a class for Obj C or C that resembles this: http://www.ee.ucl.ac.uk/~mflanaga/java/CubicSpline.html "performing an interpolation within a one dimensional array of data points, y = f(x), using a cubic spline." ...