curve

Adding alpha to Catmull-Rom

最后都变了- 提交于 2019-12-11 00:55:49
问题 I am trying to generate a Catmull-Rom curve from a list of points in Unity. As I do not want to store points in between points of the curve I opted to use a solution that could calculate a position in a Catmull-Rom curve based on time. There are a few examples of this, here and here, however, neither shows how to implement alpha. The reason I want to implement alpha is so I can have the ability to change between a centripetal, chordal, and uniform Catmull-Rom curve. private Vector3

How do I plot just the outer edge of a curve in Excel?

南笙酒味 提交于 2019-12-10 20:54:51
问题 I have data that looks like this: Risk Return 9.2 6.5 7.8 3.4 6.4 5.2 . . . . 10.2 6.4 I created a scatter plot that looks like this: How can I get just the outer edge of the curve? I'd like it to look like this: 回答1: Maybe pick off the co-ordinates for points that are nearest to the upper boundary, plot just those co-ordinates as a separate series and add a suitable trend line. Or create the envelope values from the formula shown by plotting the selection with Display Equation on chart.

Plotting a polynomial in Python

こ雲淡風輕ζ 提交于 2019-12-10 13:21:32
问题 I am new to Python plotting apart from some basic knowledge of matplotlib.pyplot . My question is how to plot some higher degree polynomials? One method I saw was expressing y in terms of x and then plotting the values. But I have 2 difficulties: y and x cannot be separated. I am expecting a closed curve(actually a complicated curve) The polynomial I am trying to plot is: c0 + c1*x + c2*y +c3*x*x + c4*x*y + c5*y*y + c6*x**3 + c7*x**2*y + ..... c26*x*y**5 + c27*y**6 All coefficients c0 to c27

Draw curved custom object in LIBGDX?

时光毁灭记忆、已成空白 提交于 2019-12-10 12:52:06
问题 I've recently been looking into LibGDX and seem to have hit a wall, seen in the picture, the blue dot represents the users finger, the map generation it self is where i seem to get stuck, does LibGDX provide a method of dynamically drawing curved objects? I could simply generate them myself as images but then the image is hugely stretched to the point of the gap for the finger can fit 3! But also would need to be 1000's of PX tall to accommodate the whole level design. Is it such that i

Terrain curve to array of points

谁说我不能喝 提交于 2019-12-10 03:45:24
问题 In my 2D game I'm using graphic tools to create nice, smooth terrain represented by black color: Simple algorithm written in java looks for black color every 15 pixels, creating following set of lines (gray): As you can see, there's some places that are mapped very bad, some are pretty good. In other case it would be not necessary to sample every 15 pixels, eg. if terrain is flat. What's the best way to covert this curve to set of points [lines], using as little points as possible? Sampling

How can I draw smoothed/rounded/curved line graphs? (C#)

情到浓时终转凉″ 提交于 2019-12-09 17:14:34
问题 I'm measuring some system performance data to store it in a database. From those data points I'm drawing line graphs over time. In their nature, those data points are a bit noisy, ie. every single point deviates at least a bit from the local mean value. When drawing the line graph straight from one point to the next, it produces jagged graphs. At a large time scale like > 10 data points per pixel, this noise is compressed into a wide jagged line area that is, say, 20px high instead of 1px as

Finding Y given X on a Cubic Bezier Curve?

给你一囗甜甜゛ 提交于 2019-12-09 14:48:48
问题 I need a method that allows me to find the Y-coordinate on a Cubic Bezier Curve, given an x-coordinate. I've come across lots of places telling me to treat it as a cubic function then attempt to find the roots, which I understand. HOWEVER the equation for a Cubic Bezier curve is (for x-coords): X(t) = (1-t)^3 * X0 + 3*(1-t)^2 * t * X1 + 3*(1-t) * t^2 * X2 + t^3 * X3 What confuses me is the addition of the (1-t) values. For instance, if I fill in the X values with some random numbers: 400 = (1

How to draw a smooth curve passing through some points

爱⌒轻易说出口 提交于 2019-12-09 09:25:43
问题 I have plot(rnorm(120), rnorm(120), col="darkblue", pch=16, xlim=c(-3,3), ylim=c(-4,4)) points(rnorm(120,-1,1), rnorm(120,2,1), col="darkred", pch=16) points(c(-1,-1.5,-3), c(4,2,0), pch=3, cex=3) I want to delineate a part of a graph, by drawing a smooth curve passing through a set of points.I can define 3-4 set of points but i cannot define a function. I would like to do this in R (as opposed to GIMP) as I would like to submit as SVG. What I would like to achieve is the following Is this

Fitting binned lognormal data in Python

北慕城南 提交于 2019-12-09 01:47:27
问题 I have a range of particle size distribution data arranged by percentage volume fraction, like so:; size % 6.68 0.05 9.92 1.15 etc. I need to fit this data to a lognormal distribution, which I planned to do using python's stats.lognorm.fit function, but this seems to expect the input as an array of variates rather than binned data, judging by what I've read. I was planning to use a for loop to iterate through the data and .extend each size entry to a placeholder array the required number of

How good is this interpolation method?

浪子不回头ぞ 提交于 2019-12-08 18:42:30
I came up with a custom interpolation method for my problem and I'd like to ask if there are any risks using it. I am not a math or programming expert, that's why I'd like a feedback :) Story: I was searching for a good curve-fit method for my data when I came up with an idea to interpolate the data. I am mixing paints together and making reflectance measurements with a spectrophotometer when the film is dry. I would like to calculate the required proportions of white and colored paints to reach a certain lightness, regardless of any hue shift (e.g. black+white paints gives a bluish grey) or