# implicit types of points and vectors, and "invisible" stored value of origin of vector

lohabithi shared this question 1 year ago

Hello, I have difficulties with the implicit types.

If I write:

L_1={(0, 1), Vector((1, 2))}

GGB plots a point and a vector.

If I write:

Line((0, 1), Vector((1, 2)))

GGB plots the line through (0,1) parallel to vector((1,2)).

This is as expected.

BUT

if I write:

Line(L_1(1), L_1(2))

then GGB plots the line through (0,1) and through THE POINT (1,2), considering the second element of the list as a point, not a vector.

However there IS a way to make GGB remember the type:

Line(Element(L_4, 1), Vector(Element(L_4, 2)))

draws the correct line.

Is that correct?

My question is: When can we use the form L_1(n), and when is it preferable to use element(L_1,n)?

These subtleties about type transmission are a little tricky, because it seems GGB, when storing a vector, "sometimes" (I am not sure when it does and when it doesn't) also stores the point of origin of that vector, even though it is not shown in the "value" of the vector, so it is difficult to remember that.

(In case you wonder why I take the trouble of typing values of points and vectors in a list: This is to force the custom tool to accept the list as input. And why do I need a list as input? It is to use the custom tool in iteration list...) 1

Thanks, there seems to be a bug with

`Line(L_1(1), L_1(2))`

`Line(Element(L_1, 1), Element(L_1, 2))`