R
Richard Price
Hello:
My name is Rich Price and I am looking for some help from a
person who is both a Ruby programmer and is mathematically
literate. Or at least more so than I am.
Here is my problem. I wish to generate open and closed cubic
splines that pass through an array of "knot" points such as:
[[x1, y1], [x2, y2], [x3, y3], [x4, y4]]
But cubic splines require control points as well as "knot"
points. I need to generate the control points that will
result in a smooth curve.
I found an article that explains how to do this and even
provides example code. But the code is written in C#
[a language that I do not know]. And I think it draws
lines whereas I want a method which would input the array
above and output a string which could then be input into a
rmagick path command. For example, taking the above array to
be an open curve and using cxn and cyn to be the generated
control points it should produce the following string:
"Mx1,y1 Ccx1,cy1 cx2,cy2 x2,y2 Scx3,cy3 x3,y3 Scx4,cy4 x4,y4"
A similar method would be needed to handle closed curves.
The article with the equations needed for the generation of
these control points can be found at:
http://www.codeproject.com/script/Articles/ArticleVersion.aspx?aid=31859&av=56252
Please let me know if you would be interested in helping me
with this problem.
My name is Rich Price and I am looking for some help from a
person who is both a Ruby programmer and is mathematically
literate. Or at least more so than I am.
Here is my problem. I wish to generate open and closed cubic
splines that pass through an array of "knot" points such as:
[[x1, y1], [x2, y2], [x3, y3], [x4, y4]]
But cubic splines require control points as well as "knot"
points. I need to generate the control points that will
result in a smooth curve.
I found an article that explains how to do this and even
provides example code. But the code is written in C#
[a language that I do not know]. And I think it draws
lines whereas I want a method which would input the array
above and output a string which could then be input into a
rmagick path command. For example, taking the above array to
be an open curve and using cxn and cyn to be the generated
control points it should produce the following string:
"Mx1,y1 Ccx1,cy1 cx2,cy2 x2,y2 Scx3,cy3 x3,y3 Scx4,cy4 x4,y4"
A similar method would be needed to handle closed curves.
The article with the equations needed for the generation of
these control points can be found at:
http://www.codeproject.com/script/Articles/ArticleVersion.aspx?aid=31859&av=56252
Please let me know if you would be interested in helping me
with this problem.