# How to show value of other quantity in caption?

Math123 shared this question 2 years ago

I draw and point(A) line segment(m).

I want length of line segment in caption of point.

$\text{A = %v}$ gives me the value of point itself. How to add value of line segment.

1

B = (0, 2)
C = (3, 0)
f = Segment(B, C)
A = Point( f )
text1 = Text("" + f, (x(A) + 0.1, y(A) + 0.1))

2

another possibility with SetCaption()-script

1

1

Is the same way as in the example SetCaption01.

SetCaption(a, "..."m"..."theta"...") sript onUpdate m

1

yes rami thanks for the support as always.

1

Thanks! I didn't know about the %v operator. In my case I want only the x coordinate, so if somebody wonders, %x also works.