Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Is there a way to draw a path that was defined by relationships between pairs centered around a specific point?

I basically want to create a path that I can translate anywhere I want in my image.

Thank you!

share|improve this question
1  
path mypath; mypath=<instructions>; draw mypath shifted (3,5); –  egreg May 9 at 14:13
    
That works provided you know the coordinates that the path is drawn So is there a way to define a starting point for your path? –  user2822693 May 9 at 14:48
    
Doesn't my example below help? With <instructions> I mean any path creation commands. –  egreg May 9 at 14:52
    
And if it did help, don't forget to mark his answer as "accepted" :-) –  fpast May 12 at 9:34

1 Answer 1

You can save the path in a variable and transform it. Example:

path mypath;

beginfig(1);
z1=(10,-10);
x1=-x4; y1=y4;
x2=x1; y2=-y1;
z3=-z1;

mypath = z1--z3--z2--z4--cycle;

draw mypath;

draw mypath shifted z2;
endfig;

end

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.