Point(stroke1,1)

Jozef Dobos shared this question 1 year ago
Answered

See attachement.

I don't understand what's going on there.

Jozef

Files: ggb5.png

Comments (4)

photo
1

If you want to work with a stroke object in GGB, then convert it to a point-list.

l1 = RemoveUndefined(First(stroke1, Length(stroke1)))

and if you need it

f = Polyline(l1)

or

a = Spline(l1, 3)

or (if possible)

g(x) = If(x(l1(1)) ≤ x ≤ x(l1(Length(l1))), FitPoly(l1, 9))

etc.

photo
1

Thank you rami,

I tried this: Sequence(Point(stroke1,k),k,0,1,0.2)

photo
1

Yes, in this case the last element (value k=1) is undefined (green). And the initialization at program start is wrong (F9 is required)

Undefined elements (in stroke1) can be removed with the conversion into a point list (red). And the program start is no problem.

photo
photo
1

I think there is a bug in creation of stroke

see the last point in the formulatext()

so to use First(stroke1, Length(stroke1) - 1) removes last undefined point and

Sequence(Point(First(stroke1, Length(stroke1) - 1), k), k, 0, 1, 0.2) works

Files: foro.ggb
© 2021 International GeoGebra Institute