ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Rotating an image
@ 2015-10-12 18:58 Fabrice Couvreur
  2015-10-15 15:27 ` Wolfgang Schuster
  0 siblings, 1 reply; 4+ messages in thread
From: Fabrice Couvreur @ 2015-10-12 18:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 655 bytes --]

A small question not directly related context.
I would like to turn my image 15 degrees.
Thanks,
Fabrice

picture pic ;
pic := currentpicture ;
u := 0.5cm ;
z1 = origin ;
z2 = (9u, 0) ;
path p ;
p := fullcircle scaled 14u ;
path q ;
q := p shifted (9u,0) ;
pair A ;
A := p intersectionpoint q ;
path a ;
a := z1 -- z2 ;
path b ;
b := z1 -- A ;
path c ;
c := z2 -- A ;
draw a ;
draw b ;
draw c ;
pair I ;
pair J ;
I := point 0.6 of b ;
J := point 0.6 of c ;
draw I -- J ;
pair L ;
L := point 0.8 of b ;
label.top("A", A) ;
label.lrt("C", z2) ;
label.llft("B", origin) ;
label.ulft("I", I) ;
label.urt("J", J) ;
label.ulft("$x$", L) ;
draw pic rotated 15 ;

[-- Attachment #1.2: Type: text/html, Size: 1414 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Rotating an image
  2015-10-12 18:58 Rotating an image Fabrice Couvreur
@ 2015-10-15 15:27 ` Wolfgang Schuster
  2015-10-15 16:36   ` Fabrice Couvreur
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Schuster @ 2015-10-15 15:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1532 bytes --]

> Fabrice Couvreur <mailto:fabrice1.couvreur@gmail.com>
> 12. Oktober 2015 um 20:58
> A small question not directly related context.
> I would like to turn my image 15 degrees.
> Thanks,
> Fabrice
>
> picture pic ;
> pic := currentpicture ;
> u := 0.5cm ;
> z1 = origin ;
> z2 = (9u, 0) ;
> path p ;
> p := fullcircle scaled 14u ;
> path q ;
> q := p shifted (9u,0) ;
> pair A ;
> A := p intersectionpoint q ;
> path a ;
> a := z1 -- z2 ;
> path b ;
> b := z1 -- A ;
> path c ;
> c := z2 -- A ;
> draw a ;
> draw b ;
> draw c ;
> pair I ;
> pair J ;
> I := point 0.6 of b ;
> J := point 0.6 of c ;
> draw I -- J ;
> pair L ;
> L := point 0.8 of b ;
> label.top("A", A) ;
> label.lrt("C", z2) ;
> label.llft("B", origin) ;
> label.ulft("I", I) ;
> label.urt("J", J) ;
> label.ulft("$x$", L) ;
> draw pic rotated 15 ;
>
\startMPpage
picture pic ;
u := 0.5cm ;
z1 = origin ;
z2 = (9u, 0) ;
path p ;
p := fullcircle scaled 14u ;
path q ;
q := p shifted (9u,0) ;
pair A ;
A := p intersectionpoint q ;
path a ;
a := z1 -- z2 ;
path b ;
b := z1 -- A ;
path c ;
c := z2 -- A ;
draw a ;
draw b ;
draw c ;
pair I ;
pair J ;
I := point 0.6 of b ;
J := point 0.6 of c ;
draw I -- J ;
pair L ;
L := point 0.8 of b ;
label.top("A", A) ;
label.lrt("C", z2) ;
label.llft("B", origin) ;
label.ulft("I", I) ;
label.urt("J", J) ;
label.ulft("$x$", L) ;
pic := currentpicture ;
currentpicture := nullpicture;
draw pic rotated 15 ;
\stopMPpage

You can also rotate the image when you place it in your document with 
\rotate[rotation=15]{...}.

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 3313 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Rotating an image
  2015-10-15 15:27 ` Wolfgang Schuster
@ 2015-10-15 16:36   ` Fabrice Couvreur
  2015-10-15 17:32     ` Alan BRASLAU
  0 siblings, 1 reply; 4+ messages in thread
From: Fabrice Couvreur @ 2015-10-15 16:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2292 bytes --]

Hi Wolfgang,
Why is it necessary to add currentpicture := nullpicture ; ?
Thank you,
Fabrice

2015-10-15 17:27 GMT+02:00 Wolfgang Schuster <schuster.wolfgang@gmail.com>:

> Fabrice Couvreur <fabrice1.couvreur@gmail.com>
> 12. Oktober 2015 um 20:58
> A small question not directly related context.
> I would like to turn my image 15 degrees.
> Thanks,
> Fabrice
>
> picture pic ;
> pic := currentpicture ;
> u := 0.5cm ;
> z1 = origin ;
> z2 = (9u, 0) ;
> path p ;
> p := fullcircle scaled 14u ;
> path q ;
> q := p shifted (9u,0) ;
> pair A ;
> A := p intersectionpoint q ;
> path a ;
> a := z1 -- z2 ;
> path b ;
> b := z1 -- A ;
> path c ;
> c := z2 -- A ;
> draw a ;
> draw b ;
> draw c ;
> pair I ;
> pair J ;
> I := point 0.6 of b ;
> J := point 0.6 of c ;
> draw I -- J ;
> pair L ;
> L := point 0.8 of b ;
> label.top("A", A) ;
> label.lrt("C", z2) ;
> label.llft("B", origin) ;
> label.ulft("I", I) ;
> label.urt("J", J) ;
> label.ulft("$x$", L) ;
> draw pic rotated 15 ;
>
> \startMPpage
> picture pic ;
>
> u := 0.5cm ;
> z1 = origin ;
> z2 = (9u, 0) ;
> path p ;
> p := fullcircle scaled 14u ;
> path q ;
> q := p shifted (9u,0) ;
> pair A ;
> A := p intersectionpoint q ;
> path a ;
> a := z1 -- z2 ;
> path b ;
> b := z1 -- A ;
> path c ;
> c := z2 -- A ;
> draw a ;
> draw b ;
> draw c ;
> pair I ;
> pair J ;
> I := point 0.6 of b ;
> J := point 0.6 of c ;
> draw I -- J ;
> pair L ;
> L := point 0.8 of b ;
> label.top("A", A) ;
> label.lrt("C", z2) ;
> label.llft("B", origin) ;
> label.ulft("I", I) ;
> label.urt("J", J) ;
> label.ulft("$x$", L) ;
> pic := currentpicture ;
> currentpicture := nullpicture;
> draw pic rotated 15 ;
> \stopMPpage
>
> You can also rotate the image when you place it in your document with
> \rotate[rotation=15]{...}.
>
> Wolfgang
>
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 5004 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Rotating an image
  2015-10-15 16:36   ` Fabrice Couvreur
@ 2015-10-15 17:32     ` Alan BRASLAU
  0 siblings, 0 replies; 4+ messages in thread
From: Alan BRASLAU @ 2015-10-15 17:32 UTC (permalink / raw)
  To: Fabrice Couvreur; +Cc: mailing list for ConTeXt users

On Thu, 15 Oct 2015 18:36:56 +0200
Fabrice Couvreur <fabrice1.couvreur@gmail.com> wrote:

> Why is it necessary to add currentpicture := nullpicture ; ?

Otherwise you will get both the unrotated as well as the rotated image!

Alan
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-10-15 17:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-12 18:58 Rotating an image Fabrice Couvreur
2015-10-15 15:27 ` Wolfgang Schuster
2015-10-15 16:36   ` Fabrice Couvreur
2015-10-15 17:32     ` Alan BRASLAU

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).