Given an arbitrary point, let's say p, that may or may not be obtained by several indirect processes such as penpos or by intersections, how do I get to display the coordinates "(px,py)" of the point in the pdf generated ? when I don't have those coordinates to beguin with ? I remember having done this once already, but I forgot how to do it.
Given a pair p
, the two values are available as xpart p
and ypart p
.
To make a string representation of the pair try:
"(" & decimal xpart p & "," & decimal ypart p & ")"
You can then type set that string as usual with infont
or the TEX()
macro.
label.bot(TEX("$(" & decimal xpart p & "," & decimal ypart p & ")$"), (10, 20));
This is rather less cumbersome if you use the built-in plain shorthand notation for pairs. So given a pair variable z1
, the two values are available as x1
and y1
. And you can make a string representation as
"(" & decimal x1 & "," & decimal y1 & ")"
z1 = p;
Thenx1
andy1
will hold the values you are looking for. You can use a label to display them in the PDF. – TeXnician Sep 14 at 20:55