How to use sequence on a list of points

Spijk shared this question 2 months ago
Answered

I have six points named A1, A2, ..., A6. Now, I want to make the points B1, B2, ..., B6 with their y one above the A-points. Could I somehow use the sequence command for this, like Sequence(Point(x(An),y(An)+1),n,1,6)?

Best Answer
photo

Execute(Sequence("B"+k+"=A"+k+"+(0,1)",k,1,6))

Comments (5)

photo
2

Execute(Sequence("B"+k+"=A"+k+"+(0,1)",k,1,6))

photo
1

Thank you! This works really well

photo
photo
2

Hi Spijk!


Yes, you can do it. ;-)

If L={A1, A2, A3, .., A6} is the list of your points, you can use e. g. the command:

Sequence((x(Element(L, k)), 1 + y(Element(L, k))), k, 1, Length(L))

Kind regards

mire2

photo
1

This solution works for a small amount of An's, but once you need for example A1-A99 or more, this becomes hard to use.

photo
1

in this case use L=A1:A99, so simple

you can define B1=A1+(0,1), then select B1 and drag down the little blue square rigth down of B1 cell

photo
© 2018 International GeoGebra Institute