# In Metapost, access the points of a path copy

In Metapost, I want to copy a path and be able to address the points directly. I tried this, but it seems like `pp1` doesn not exists. Any idea how to do it?

``````beginfig(1);
pair p[];
p1=(0,100);
p2=(50, 0);
p3=(100,100);

pair pp[];
pp := p shifted (25, 0);

show p;
show pp;

draw p -- pp;
endfig;
``````

`p` is not a path, it is an array. You have to iterate over all the suffixes and shift them:

``````beginfig(1);
pair p[];
p1=(0,100);
p2=(50, 0);
p3=(100,100);

pair pp[];

forsuffixes i = 1,2,3  :
pp[i] := p[i] shifted (25, 0);
endfor

show p;
show pp;

draw p -- pp;
endfig;
end;
``````

The other option is to actually define a `path` and then access individual points using `point n of path`:

``````beginfig(1);
path p, pp;

p := (0,100) -- (50,0) -- (100,100);
pp := p shifted (25, 0);

show point 0 of p;
show point 0 of pp

draw point 0 of p -- point 0 of pp;
endfig;
end;
``````
• Technically `pair p[]` does not really define an array either; it's more a collection of variables with a common prefix. So, for example, you are not limited to using integers as suffixes: after `pair p[]`, you could use `p.A`, `p.2r`, etc as well as `p1`... – Thruston Jan 25 '18 at 8:27