Re: [NTG-context] Units of xpart and ypart of a pair in MetaFun

2020-11-27 Thread Keith McKay
Thanks Taco! I understand much better now. I think it's best to leave the units out until the drawing stage as you suggest. Thanks again Keith McKay On Fri, 27 Nov 2020, 08:30 Taco Hoekwater, wrote: > > > > On 26 Nov 2020, at 16:09, Keith McKay wrote: > > > > Hi, > > > > I have been using

Re: [NTG-context] Units of xpart and ypart of a pair in MetaFun

2020-11-27 Thread Taco Hoekwater
> On 26 Nov 2020, at 16:09, Keith McKay wrote: > > Hi, > > I have been using xpart and ypart to extract these values from pairs of > points in a path but I wasn't getting the correct result. I was expecting: > > pair (2cm, 11cm) to give xpart 2 and ypart 11 As explained by various people,

Re: [NTG-context] Units of xpart and ypart of a pair in MetaFun

2020-11-26 Thread Keith McKay
/First « //uniformdeviate(1) - 0.5// » could be modified to « //uniformdeviate(0.5)//»./ / / /To add noise, you can use the randomized function of Metafun. For exemple, you can write:/ / / /draw pp randomized 1cm ;/ / / That's true Fabrice but in this use case I wanted a random number between

Re: [NTG-context] Units of xpart and ypart of a pair in MetaFun

2020-11-26 Thread Keith McKay
Thanks again Hans and Fabrice, for the time you have both taken with my question and thanks for the code snippet Hans. Just one last confirmation from the snippet. Hans uses the correction factor cf on the x and yparts of a[i]. I taking this as meaning that this has to be done because the x

Re: [NTG-context] Units of xpart and ypart of a pair in MetaFun

2020-11-26 Thread Fabrice L
Keith, > Le 26 nov. 2020 à 12:12, Keith McKay a écrit : > Thanks Fabrice and Hans. > > I now see I can simplify some lines of the code: > > pp := ((xpart a[i])/cf*cm, (ypart a[i])/cf*cm); now becomes pp:= a[i]; > > and > > pp := pp --- ((xpart a[i+1]/cf)*cm, (ypart a[i+1])/cf*cm); now

Re: [NTG-context] Units of xpart and ypart of a pair in MetaFun

2020-11-26 Thread Hans Hagen
On 11/26/2020 6:12 PM, Keith McKay wrote: Thanks Fabrice and Hans. I now see I can simplify some lines of the code: pp := ((xpart a[i])/cf*cm, (ypart a[i])/cf*cm); now becomes pp:= a[i]; and pp := pp --- ((xpart a[i+1]/cf)*cm, (ypart a[i+1])/cf*cm); now becomes pp := pp --- a[i +1] ;

Re: [NTG-context] Units of xpart and ypart of a pair in MetaFun

2020-11-26 Thread Keith McKay
Thanks Fabrice and Hans. I now see I can simplify some lines of the code: pp := ((xpart a[i])/cf*cm, (ypart a[i])/cf*cm); now becomes pp:= a[i]; and pp := pp --- ((xpart a[i+1]/cf)*cm, (ypart a[i+1])/cf*cm); now becomes pp := pp --- a[i +1] ; However I still have the problem in the

Re: [NTG-context] Units of xpart and ypart of a pair in MetaFun

2020-11-26 Thread Hans Hagen
On 11/26/2020 4:09 PM, Keith McKay wrote: Hi, I have been using xpart and ypart to extract these values from pairs of points in a path but I wasn't getting the correct result. I was expecting: pair (2cm, 11cm) to give xpart 2 and ypart 11 However I was getting: pair (2cm, 11cm) -> xpart

Re: [NTG-context] Units of xpart and ypart of a pair in MetaFun

2020-11-26 Thread Fabrice L
Hi keith, > Le 26 nov. 2020 à 10:09, Keith McKay a écrit : > > Hi, > > I have been using xpart and ypart to extract these values from pairs of > points in a path but I wasn't getting the correct result. I was expecting: > > pair (2cm, 11cm) to give xpart 2 and ypart 11 > > However I was

[NTG-context] Units of xpart and ypart of a pair in MetaFun

2020-11-26 Thread Keith McKay
Hi, I have been using xpart and ypart to extract these values from pairs of points in a path but I wasn't getting the correct result. I was expecting: pair (2cm, 11cm) to give xpart 2 and ypart 11 However I was getting: pair (2cm, 11cm) -> xpart 56.6929 and ypart 311.8096 After much head