Gary
GaryVasco
Posts: 3,352
|
Post by Gary on Jan 30, 2016 6:28:27 GMT
Vasco,
How are you able to plot the irregular curves in Exercise 16? I tried the BezierCurve function in Mathematica, but found it to be difficult to work with.
Gary
|
|
|
Post by Admin on Jan 30, 2016 17:35:47 GMT
Gary
As you know I use the graphics package called PSTricks inside Latex. The command I used in the exercise for the second diagram looks like this
\psccurve [fillstyle=solid,fillcolor=lightgray](8.2,2.5)(7.5,4)(4.5,5.4)(3.8,4.4)(4.2,.5)(6,.2)(7.8,1)
To get a closed curve you put in the extra "c" for closed, thus: "\ps-c-curve" (without the dashes). For open curves it is just "\pscurve"
According to some internet searching I have done, PSTricks uses Bezier curves to do this.
Vasco
|
|
Gary
GaryVasco
Posts: 3,352
|
Post by Gary on Jan 30, 2016 20:49:15 GMT
Vasco,
Thanks. When I used your numbers in Mathematica’s BezierCurve[] function, I got a similar shape, but with vertices, not smooth. I browsed around a bit and found BSplineCurve[]. The following, with your numbers, gave the desired shape:
BSplineCurve[{{8.2, 2.5}, {7.5, 4}, {4.5, 5.4}, {3.8, 4.4}, {4.2, .5}, {6, .2}, {7.8, 1}}, SplineClosed -> True]
The documentation on this topic is typically rudimentary or very specialized, with little in between. Do you have a method other than trial-and-error for picking the numbers?
Gary
|
|
|
Post by Admin on Jan 31, 2016 0:01:52 GMT
Gary
Here is the command I used for the other shape in case knowledge of the points is useful to you
\psccurve [](6.6,4)(1.2,4)(1.3,3.3)(2.6,3.1)(4,.4)(4.9,2)(7.8,2.3)
What I did to help me choose the points was to draw the curve I wanted on a piece of graph paper by hand and then read off the points that I thought would describe the curve adequately. In PSTricks there is an option to display or not display the points and so with a bit of adjustment I managed to very quickly arrive at a set of suitable points to get \psccurve to draw a shape very similar to the one on the graph paper.
Hope this helps.
Vasco
|
|
Gary
GaryVasco
Posts: 3,352
|
Post by Gary on Jan 31, 2016 4:55:19 GMT
What I did to help me choose the points was to draw the curve I wanted on a piece of graph paper by hand and then read off the points that I thought would describe the curve adequately. In PSTricks there is an option to display or not display the points and so with a bit of adjustment I managed to very quickly arrive at a set of suitable points to get \psccurve to draw a shape very similar to the one on the graph paper. ... Vasco That was to be my next step. Thanks. Gary
|
|
Gary
GaryVasco
Posts: 3,352
|
Post by Gary on Feb 1, 2016 6:00:47 GMT
Vasco, I tried to plot amplitwist and velocity vectors pertaining to Exercise 16. It was somewhat tricky for a couple of reasons. The negative exponents require different plot dimensions and perspectives and the Bezier spline functions were new to me. How does one get amplitwist and velocity from a Bezier spline curve? I think it makes some sense to take tangents from closest neighbor points on the actual curve (not the anchor points), as in Figure 2. But for figures 3 and 4 I used formulas for amplitwist and velocity. And if one is to use a radius in calculations, one needs a center. The centroid provides an approximation to a center. Finally, I tossed up my hands at the problem of trying to map interior to exterior points with an analytic function applied an analytic function on a bezier spline curve. I think I will need to go back and study the cross-ratio (p. 106). ... Gary Diagrams revised and sourcecode added, Feb 3. It is easier to begin with the unit circle. In Figure 2(b), I wasn't sure about the best way to illustrate the negative value of $\overset{~}{\kappa}$. I just noticed that the velocity $\frac{dw}{d\theta}$ in 2(b) points in the wrong direction, so I will take another look at that. I rewrote it and added derivation of velocity vector to the discussion on Jan 4, but with same result in plot. Found the programming error that gave the wrong velocity vector and replaced both files, Feb. 12, 2016. nh.ch5.ex16.pdf (210.03 KB) nh.ch5.ex16.src.pdf (143.12 KB)
|
|
|
Post by Admin on Feb 1, 2016 7:19:00 GMT
Gary
After a cursory read through your solution files, what struck me was that you do not appear to be using an origin-centred circle as your starting point. Am I missing something?
Vasco
|
|
Gary
GaryVasco
Posts: 3,352
|
Post by Gary on Feb 1, 2016 15:27:18 GMT
Vasco,
>>After a cursory read through your solution files, what struck me was that you do not appear to be using an origin-centred circle as your starting point. Am I missing something?
No, you are right. As so often happens when I start working on a problem, I go off on tangents and forget the premises of the original question. In this case, I got interested in how the oval shaped and non-convex curves were produced with Bezier spline function and forgot that the problem specified beginning with an origin-centred circle. So I will revise, but I have to say it was interesting to begin with the irregular shape.
Gary
|
|
|
Post by Admin on Feb 1, 2016 15:49:07 GMT
Gary
Yes, I've had a closer look since my post, and your diagrams and accompanying text are certainly interesting. It should be easier to program if you start with a circle I think. I first encountered cubic splines quite a few years ago now. They are certainly very useful if you want to fit a smooth curve to data.
Vasco
|
|