parametric-equations

Placing points equidistantly along an Archimedean spiral

佐手、 提交于 2019-12-24 07:14:58
问题 I have an Archimedean spiral determined by the parametric equations x = r t * cos(t) and y = r t * sin(t) . I need to place n points equidistantly along the spiral. The exact definition of equidistant doesn't matter too much - it only has to be approximate. Using just r , t and n as parameters, how can I calculate the coordinates of each equidistant point? 回答1: You want to place points equidistantly corresponding to arc length. Arc length for Archimedean spiral (formula 4) is rather complex s

Parametric Expression of a Bezier Curve

拈花ヽ惹草 提交于 2019-12-12 01:44:09
问题 I have used the Parametric Expression of a Bezier Curve to locate a point along my curve and it's working as it should. The problem is I'm setting my t value as the percentage of the y axis and unfortunately (and obviously) it doesn't correlate because my curve is longer than my Y axis. So in this program if I set my Y Value to 75 I want to return the point on my line that sits at the Y value of 25 (the inverse because in iOS the (0, 0) sits at the top left instead of the bottom left as my

Plot survival and hazard function of survreg using curve()

江枫思渺然 提交于 2019-12-03 13:18:53
问题 I have the following survreg model: Call: survreg(formula = Surv(time = (ev.time), event = ev) ~ age, data = my.data, dist = "weib") Value Std. Error z p (Intercept) 4.0961 0.5566 7.36 1.86e-13 age 0.0388 0.0133 2.91 3.60e-03 Log(scale) 0.1421 0.1208 1.18 2.39e-01 Scale= 1.15 Weibull distribution I would like to plot the hazard function and the survival function based on the above estimates. I don't want to use predict() or pweibull() (as presented here Parametric Survival or here SO question

Plot survival and hazard function of survreg using curve()

随声附和 提交于 2019-12-03 03:27:35
I have the following survreg model: Call: survreg(formula = Surv(time = (ev.time), event = ev) ~ age, data = my.data, dist = "weib") Value Std. Error z p (Intercept) 4.0961 0.5566 7.36 1.86e-13 age 0.0388 0.0133 2.91 3.60e-03 Log(scale) 0.1421 0.1208 1.18 2.39e-01 Scale= 1.15 Weibull distribution I would like to plot the hazard function and the survival function based on the above estimates. I don't want to use predict() or pweibull() (as presented here Parametric Survival or here SO question . I would like to use the curve() function. Any ideas how I can accomplish this? It seems the Weibull

How to plot polar coordinates in R?

蓝咒 提交于 2019-12-01 06:07:29
Suppose that (x(t),y(t)) has polar coordinates(√t,2πt). Plot (x(t),y(t)) for t∈[0,10]. There is no proper function in R to plot with polar coordinates. I tried normal plot by giving, x=√t & y=2πt. But resultant graph was not as expected. I got this question from "Introduction to Scientific Programming and Simulation using r"and the book is telling the plot should be spiral. Make a sequence: t <- seq(0,10, len=100) # the parametric index # Then convert ( sqrt(t), 2*pi*t ) to rectilinear coordinates x = sqrt(t)* cos(2*pi*t) y = sqrt(t)* sin(2*pi*t) png("plot1.png");plot(x,y);dev.off() That doesn

How to plot polar coordinates in R?

大城市里の小女人 提交于 2019-12-01 03:38:28
问题 Suppose that (x(t),y(t)) has polar coordinates(√t,2πt). Plot (x(t),y(t)) for t∈[0,10]. There is no proper function in R to plot with polar coordinates. I tried normal plot by giving, x=√t & y=2πt. But resultant graph was not as expected. I got this question from "Introduction to Scientific Programming and Simulation using r"and the book is telling the plot should be spiral. 回答1: Make a sequence: t <- seq(0,10, len=100) # the parametric index # Then convert ( sqrt(t), 2*pi*t ) to rectilinear

Equation-driven smoothly shaded concentric shapes

て烟熏妆下的殇ゞ 提交于 2019-11-30 12:36:35
问题 Background Looking to create interesting video transitions (in grayscale). Problem Given equations that represent a closed, symmetrical shape, plot the outline and concentrically shade the shape towards its centre. Example Consider the following equations: x = 16 * sin(t)^3 y = 13 * cos(t) - 5 * cos(2 * t) - 2 * cos(3 * t) - cos(4 * t) t = [0:2 * pi] When plotted: When shaded, it would resemble (not shown completely shaded, but sufficient to show the idea): Notice that shading is darkest on

Equation-driven smoothly shaded concentric shapes

时光总嘲笑我的痴心妄想 提交于 2019-11-30 03:12:10
Background Looking to create interesting video transitions (in grayscale). Problem Given equations that represent a closed, symmetrical shape, plot the outline and concentrically shade the shape towards its centre. Example Consider the following equations: x = 16 * sin(t)^3 y = 13 * cos(t) - 5 * cos(2 * t) - 2 * cos(3 * t) - cos(4 * t) t = [0:2 * pi] When plotted: When shaded, it would resemble (not shown completely shaded, but sufficient to show the idea): Notice that shading is darkest on the outside (e.g., #000000 RGB hex), then lightens as it fills to the centre. The centre would be a

Plot a heart in R [duplicate]

 ̄綄美尐妖づ 提交于 2019-11-28 02:52:54
Possible Duplicate: Equation-driven smoothly shaded concentric shapes How could I plot a symmetrical heart in R like I plot a circle (using plotrix) or a rectangle? I'd like code for this so that I could actually do it for my self and to be able to generalize this to similar future needs. I've seen even more elaborate plots than this so it's pretty doable, it's just that I lack the knowledge to do it. This is an example of plotting a "parametric equation", i.e. a pairing of two separate equations for x and y that share a common parameter. You can find many common curves and shapes that can be

Plot a heart in R [duplicate]

谁说胖子不能爱 提交于 2019-11-26 23:52:05
问题 Possible Duplicate: Equation-driven smoothly shaded concentric shapes How could I plot a symmetrical heart in R like I plot a circle (using plotrix) or a rectangle? I'd like code for this so that I could actually do it for my self and to be able to generalize this to similar future needs. I've seen even more elaborate plots than this so it's pretty doable, it's just that I lack the knowledge to do it. 回答1: This is an example of plotting a "parametric equation", i.e. a pairing of two separate