Simple movable point interactivity #80
Answered
by
karkir0003
karkir0003
asked this question in
Help
-
Any example code to write a function y = f(x) and given a point on the function, move it along? Eg: given y = 2x + 5 and the starting point (0,5), how would I use mafs to move the (0,5) point along the y = 2x + 5 function |
Beta Was this translation helpful? Give feedback.
Answered by
karkir0003
Jan 10, 2023
Replies: 1 comment
-
Never mind. Got it to work. I just had to define the constrain as useMovablePoint(..., {
constrain: ([x, y]) => [
x,
<enter f(x) here>
]
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
stevenpetryk
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Never mind. Got it to work. I just had to define the constrain as