Re: [NTG-context] METAPOST's superellipse with superness0.5 does not give a superellipse

2010-03-02 Thread James Fisher
Thanks, Rory. In hind-sight I guess my presumptions look pretty silly. The reason I'm making mistakes like this is that I can't find any introductory text along the lines of 'TeX for programmers'; i.e. people coming from your typical modern imperative languages, who will (after looking at TeX

[NTG-context] METAPOST's superellipse with superness0.5 does not give a superellipse

2010-03-01 Thread James Fisher
Hi again, Another METAPOST problem. For the sake of curiosity, I've been looking at and playing with the superellipse() function in plain METAPOST. This is all fine and dandy until I try values of 'superness' less than 0.5, in which case it generates shapes that are seemingly not

Re: [NTG-context] METAPOST's superellipse with superness0.5 does not give a superellipse

2010-03-01 Thread James Fisher
I should say that the vertices of the superellipse are calculated correctly. The problem, it seems, is that for the vertices at right, top, left, and bottom, the angles of entry and exit need to be explicitly defined, rather than just relying on the '...' which coincidentally works for s=0.5. I

Re: [NTG-context] METAPOST's superellipse with superness0.5 does not give a superellipse

2010-03-01 Thread Rory Molinari
James's explanation appears to be right. On p 126 of the METAFONTbook Knuth says that the superness should be between 0.5 (when you get a diamond) and 1.0 (when you get a square). Exercise 14.6 asks the reader to Try superellimpse with superness values less than 0.5 or greater than 1.0; explain

Re: [NTG-context] METAPOST's superellipse with superness0.5 does not give a superellipse

2010-03-01 Thread James Fisher
I've come up with a crude function that's doing more like what I want. I have two problems with it: 1. The most important: I need to differentiate the equations that generate a superellipse, in order to find the tangent at the defined vertices. I have failed to do this and so use a crude

Re: [NTG-context] METAPOST's superellipse with superness0.5 does not give a superellipse

2010-03-01 Thread Rory Molinari
For 2: I think Metafont makes more sense if you don't think of a macro as a function that does some work in its own context and returns a value, but as something that expands textually in place. So there isn't any concept of return as there aren't separate stack frames to return from or to. So