Dynaverse.net
Off Topic => Engineering => Topic started by: FoaS_XC on August 07, 2010, 10:19:52 pm
-
Okay guys, I need a favor.
I'm trying to wrap my head around some Bezier math and I can't find any reference to anything I need.
So, suppose I have a set of coordinates:
(x,y)
0,90
1,90
2,90
3,45
8,30
15,15
16,0
When charted and interpolated linearly the chart looks something like this.
(http://img705.imageshack.us/img705/3900/lineard.jpg)
Now, I want to do something like smoothing approximation - Something that would look like this.
(http://img836.imageshack.us/img836/1558/smoothed.jpg)
Now, What I need to do is grab the Y-coordinate of a point on that interpolation when the X-coordinate is known.
(http://img266.imageshack.us/img266/7469/whatisy.jpg)
-
I wouldn't smooth the chart myself. It will make finding the in between easier and you don't lose specific points like you did on your chart. Look at X=3, the y changes between the normal and smoothed chart. Doing a spline is fine but it has to keep the fixed points that you build the spline from I would think.
-
I'm alright with having the approximation values not neededly coincide directly with the values given. A linear interpretation (each data-point is guaranteed to be in the right place with linear interpolation) might be okay if a smoothed interpolation is too much off-key.
-
now, I would say, make a function that would run a chart for each table that is needed. You call the function needed for the chart needed. That way, you can run the math however it is needed to get the best results. We will work a few numbers here (the little 'un) and see if we can get a formula that might work for the example and a generic one that might work on more also.
-
Oh how I love you, marstone :-D.
I'm chewing on something myself.
-
The point at 2.5 would be 67.5 or Y = 67.5
Is that what you are asking?
Stephen
-
I'm asking What would be the function to find that answer? how did you get 67.5?
-
Ahh, that was easy, divided 45 by 2 which I got from the points 2 and 3, then added it to 45.
That gave me the middle point for 2.5 .
If say you wanted a point at 2.25 or 2.75, you would just divide by 4, and add appropriately.
Stephen
-
That is linear interpolation, basically. Which would be fine if I needed to find Y of a known X point on the first graph, but I need to know how to find Y on a known X when the data has been smoothed over.
-
give us a day or so, other games are taking some time away from being able to work on it right away. It really shouldn't be that tough of a problem (just way to many years out of math for myself, looking at getting a refresher at the university tho).
Starting to read some source code from Plane shift also. getting a feel for it.
-
The answer is 42. :laugh: :laugh: :laugh:
-
Okay, here's what I'm doing: I'm building a Spline in 3ds max with vertices at the location given. I'm then smoothing it with the built in NURMS system with 2 Iterations. I'm then going to record the location of each of the NEW vertices. We will then interpolate linearly between them all. Basically I'm tripling our dataset.
-
grab a ti 83/89 etc (or use matlab or something) it has other methods which will pop out an equation to fit your points ;)
-
Well, since you're extrapolating a curve from some data points, the curve doesn't match those data points when you have known data points... so guesstimate what the Y value is, and it will be as accurate as any other method.