gdoug

30 Reputation

4 Badges

10 years, 167 days

MaplePrimes Activity


These are replies submitted by gdoug

@Carl Love Sorry that its taken a while to reply, too many projects on the go!

The code as posted works. But if I try a different input, say,

HeadToTail([`<,>`(0, 1), `<,>`(2, 2), `<,>`(3, 3)])


then it doesn't work. I am using maple 18.

@Kitonum Yup that works!

Here is my final generalized solution:

ProjectOntoCurve := proc (f, point)
local projected, Eq;
Eq := y = f(x0)-(x-x0)/(D(f))(x0);
projected := fsolve(eval(Eq, `~`[`=`]([x, y], point)), x0 = 0 .. infinity);
return [projected, f(projected)]
end proc;


@Carl Love 

 

This didn't work for me. If I tried with a single arrow (say, <1,1>) it went from <0, 0> to <-1, -1>. I am unfortunetly not familiar enough with Maple's syntax to correct it and repost a working solution either.

Page 1 of 1