How to create a spline x->y (not t->x, t->y)?

s_o shared this question 5 years ago
Answered

I would like to create spline curve between several points that is x->y. Reason for that is, I would like to show the derivative (d/dx) of that spline (I would like to move the points and the derivative changes the same time).


It seems there is no general purpose invert command that allows inverting the x(t) of the spline and substituting into y(t) of the spline.

Best Answer
photo

I meant to share one work with problem in your post

when I clic in your link I do not know where is the problem

but if you have a curve (x(t),y(t)) you have not get a x->y derivate because the curve can have double points for some t

so I suposse you want ordered points and a(t) function (sometimes a(t) is a curve although the points are ordered)

perhaps this one

Files: foro.ggb

Comments (13)

photo
1

I do not understand why the new users does not share their works.

the old user are working in the dark

is this you want?

or did you want to use polynomial[<list of points>]?

saludos

PD: this post https://www.geogebra.org/he... can help you

Files: foro.ggb
photo
1

I'm sorry, I don't understand your problem, I've shared my work: https://www.geogebra.org/s_o

As for this problem, there is nothing to share:

-create 5 points A-E

-do Spline[A,B,C,D,E]

=> Youl'll get a spline function t->x and t->y (like the manual says, like in your file).

I would like to have a function x->y (of course I know this is only possible if x(A)<x(B)<x(C)<x(D)<x(E) ). I have not found any solution on that. A polynomial is not what I would like to have, as it will oscillate.

You're work is similar to what I would like to create: It creates the derivative as a trace of a point during the animation. I would like to be able to move a point and instantly the derivative changes, for that I need a spline function x->y (any other ideas?).

photo
3

I meant to share one work with problem in your post

when I clic in your link I do not know where is the problem

but if you have a curve (x(t),y(t)) you have not get a x->y derivate because the curve can have double points for some t

so I suposse you want ordered points and a(t) function (sometimes a(t) is a curve although the points are ordered)

perhaps this one

Files: foro.ggb
photo
1

this is excellent, thanks @mathmagic

photo
photo
1

Thank you very much, that trick is exactly what I was looking for!

photo
1

@mathmagic's solution is nice, there is also the command ParametricDerivative[a] to get the derivative function.


Note that the splines that GeoGebra produces are not always functions, see https://www.geogebra.org/he... for details.

photo
1

I wanted to ask a similar question, this is how I found this thread.

I see now how to create a parametric curve from a spline.

Is there a way to create a function?

Besides the derivative, I would also like to draw the integral function.

photo
1
photo
1

Yes, this is the functionality I am looking for. However, when I downloaded and looked at the details of https://www.geogebra.org/m/QW6bURhd , I ran into problems.

  • I wanted to see how this spline compares to the spline created by geogebra. I tried to use the command Spline({A_1,A_2,A_3,A_4,A_5}), but I got an error message. Is it possible the the javascript code conflicts with or overrides the geogebra Spline command?
  • I tried to graph the integral of f_1, but geogebra says that it is undefined. I am not sure why, it is a cubic polynomial, so integrating it should not be a problem. I get the derivative without problem.

I am using Geogebra 5 on Mac OS

photo
1

there are no known conflicts of javascript code to build in commands. but spline command return a parametric curve not a function. got error undefined multiplication???

the spline functions have an if-clause to define the range. perhaps you have to get rid of the if clause.

even a possible a conflict ggb6 - ggb5, see settings if sub character is in brackets A_{1}?

photo
1

The integral was indeed the problem of restricted domain. It seems, that Geogebra cannot take the integral of a function on restricted domain. I have to look at your javascript code and have to work around this problem.

However, I still do not understand the problem with spline. I just tried your online version, I also got the same "illegal multiplication" error message as with the downloaded version.

photo
1

write the function name to cas where you can copy and edit the function.

perhaps make a bug report to michael

pointing to this post and file?

photo
© 2022 International GeoGebra Institute