vector command gets corrupted when I enter it

Lenore shared this problem 4 years ago
Not a Problem

I type

Sequence(Sum(If(k ≠ j, Vector(Element(L_1, k), Element(L_1, j)) / Distance(Element(L_1, k), Element(L_1, j))³, 0), j, 1, 10), k, 1, 10)

What goes into the algebra list is

Sequence(Sum(If(k ≠ j, Vector(Vector(Element(L_1, k), Element(L_1, j)) / Distance(Element(L_1, k), Element(L_1, j))³), 0), j, 1, 10), k, 1, 10)

The latter is of course gibberish and so all the vectors created are of the form (?,?).

GeoGebra Classic 5.0.426.0-d (30 January 2018) running on MacOS 10.13.6

Java: 1.8.0_20

Codebase: file:/Applications/GeoGebra%205.app/Contents/Resources/Java/

OS: Mac OS X

Architecture: x86_64 / null

Comments (2)

photo
1

I think your command is wrong because sum must add vectors

try

Sequence(Sum(If(k ≠ j, Vector(Element(L_1, k), Element(L_1, j)) / Distance(Element(L_1, k), Element(L_1, j))³, (0,0)), j, 1, 10), k, 1, 10)

or better try

Sequence(Vector(Sum(If(k ≠ j, (Element(L_1, j) - Element(L_1, k)) / Distance(Element(L_1, k), Element(L_1, j))³, (0,0)), j, 1, 10)), k, 1, 10)

photo
1

So how can I predict when and If statement must have something specific to do when the test is false and when I can just leave that empty?

© 2023 International GeoGebra Institute