I am trying to solve B-Spline equations using De-Boors method. All in all, the method will generate equations that will then have to be solved. What is the best way to represent an equation in code as a variable? I was thinking, just pushing each variable, coefficients, and operators in an array. I would also create a function to interpret these "equation" arrays for solving once variables are available for plug in. Is there a better way to represent equations that are not known until later in execution? Sort of like a variable but for an equation. Example, equation1 = [7,"xxx","+","(",2,"y","-","x",")",3,"yy"] representing 7x^3 + (2y-x)3y^2
Asked
Active
Viewed 35 times
0
-
google [expression evaluation](https://stackoverflow.com/a/20919547/2521214) the idea is to store the stuff as string ... anyway for solving you would need algebraic math engine. However I see no need to solve equations for B-Splines in this way... they have known equations constructed from degree and input control points/vectors/knots depending on the curve type ... so you most likely doing this wrongly what exactly is your input and wanted output ? Also N-D parametric curves are done separately for each axis so why you combine x,y, in single equation? – Spektre Jul 27 '20 at 06:53
-
see [cubic bezier example](https://stackoverflow.com/a/20517874/2521214) – Spektre Jul 27 '20 at 06:56