Re: [Groff] Problems with arcs and angles

2017-05-09 Thread Werner LEMBERG
> Can anyone shed light on why groff deviates from CSTR 54 theory and > historic practice? I guess it's simply a bug. It would be great if there were a test suite for the PIC to catch such errors... Werner

Re: [Groff] Problems with arcs and angles

2017-05-09 Thread Ralph Corderoy
Hi John, > > In the groff source, adjust_arc_center() seems the culprit that many > > of the output devices call to mess with arc's calculations. > > Well... right and wrong way aside, I'm simply glad to have achieved > parity with grops/gropdf. CSTR 54 documents the DIT format, `Da' included. P

Re: [Groff] Problems with arcs and angles

2017-05-09 Thread John Gardner
> > *The documentation is correct. The code is wrong. Later code copied > earlier code.* Ugh, that's even more confusing. Looks like gropdf's comments could do with a clean-up: these lines had me confused as well: # do it in 4 pieces my $totang=($endang-$startang)/4; > # Now 1 piece > my $x0=

Re: [Groff] Problems with arcs and angles

2017-05-09 Thread Ralph Corderoy
Hi John, > Looks like there's a mistake in groff_out(5). It describes its > arc-drawing command as: Da h1 v1 h2 v2⟨line-break⟩ Draw arc from current position to (h1, v1)+(h2, v2) with center at (h1, v1); then move the current position to the final point of the arc. CS

Re: [Groff] Problems with arcs and angles

2017-05-09 Thread John Gardner
Fair enough. Well, the grops code worked for me too , actually. Thanks to everybody again for their help. =) On 9 May 2017 at 21:23, Deri James wrote: > On Tue 09 May 2017 13:55:38 John Gardner wrote: >

Re: [Groff] Problems with arcs and angles

2017-05-09 Thread Deri James
On Tue 09 May 2017 13:55:38 John Gardner wrote: > Looks like there's a mistake in groff_out(5). It describes its arc-drawing > command as: > > *Draw arc from current position to (h1, v1)+(h2, v2) with center at (h1, > > > v1);* > > However, gropdf.pl tells a different story. To quote line #2791:

Re: [Groff] Problems with arcs and angles

2017-05-08 Thread John Gardner
Looks like there's a mistake in groff_out(5). It describes its arc-drawing command as: *Draw arc from current position to (h1, v1)+(h2, v2) with center at (h1, > v1);* However, gropdf.pl tells a different story. To quote line #2791:

Re: [Groff] Problems with arcs and angles

2017-04-30 Thread John Gardner
Sorry for the delayed response. Some pull-requests needed tending to before I had a chance to go through all this. First, thank you all so much for your help and patience! It truly means a lot. I've not yet got arcs drawing correctly, but I feel I'm coming close. Branden's pointers on trigonometry

Re: [Groff] Problems with arcs and angles

2017-04-28 Thread Ralph Corderoy
Hi John, > > Gorgeous. :-) > Groff's output gives me these coordinates to go by: > >

Re: [Groff] Problems with arcs and angles

2017-04-28 Thread G. Branden Robinson
At 2017-04-28T17:40:37+1000, John Gardner wrote: > > > > Does this help or did I manage to misunderstand you completely? > > > I'm afraid so... the issue isn't with calculating radii, but calculating > the `startAngle` and `endAngle`. Right. I got that but apparently communicated poorly. Sorry

Re: [Groff] Problems with arcs and angles

2017-04-28 Thread Jones, Larry
> -Original Message- > From: Jones, Larry (DF PL PDS EI US) > Sent: Friday, April 28, 2017 10:27 AM > To: 'John Gardner' > Subject: RE: [Groff] Problems with arcs and angles > > startAngle = atan2(startY - centreY, startX - centreX) > endAngle = at

Re: [Groff] Problems with arcs and angles

2017-04-28 Thread John Gardner
> > Does this help or did I manage to misunderstand you completely? I'm afraid so... the issue isn't with calculating radii, but calculating the `startAngle` and `endAngle`. This is perhaps better explained with an example: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2

Re: [Groff] Problems with arcs and angles

2017-04-27 Thread G. Branden Robinson
At 2017-04-28T15:31:30+1000, John Gardner wrote: > This might be the wrong forum to ask for help with trigonometry, but I > was planning to announce progress eventually anyway. I have no experience with pic, but I faintly recall some trig. Maybe I can help. > Now, this pic code: > > .PS > > "+"

[Groff] Problems with arcs and angles

2017-04-27 Thread John Gardner
Hello! Some time ago, I announced my intent to build a man-page previewer for a text-editor named Atom . Work is coming along nicely: this page was generated using a lightweig