POV-Ray : Newsgroups : povray.off-topic : Boat/river puzzle Server Time
3 Sep 2024 17:18:05 EDT (-0400)
  Boat/river puzzle (Message 1 to 9 of 9)  
From: scott
Subject: Boat/river puzzle
Date: 30 Nov 2010 11:31:53
Message: <4cf526f9$1@news.povray.org>
Maybe some of you remember the problem from basic vector math class, where a 
boat must travel across a flowing river to a certain point, and you need to 
calculate which direction the boat should point.

The captain of a certain boat is not so clever though, and just aims his 
boat straight at the destination, of course the boat starts to get pushed 
off course by the river current, but the captain keeps the boat pointed at 
the destination at all times.  Eventually (assuming the boat can overcome 
the river current) the boat reaches the destination.  What shape curve did 
the boat trace out?


Post a reply to this message

From: Le Forgeron
Subject: Re: Boat/river puzzle
Date: 30 Nov 2010 15:43:58
Message: <4cf5620e@news.povray.org>
Le 30/11/2010 17:31, scott nous fit lire :
> Maybe some of you remember the problem from basic vector math class,
> where a boat must travel across a flowing river to a certain point, and
> you need to calculate which direction the boat should point.
> 
> The captain of a certain boat is not so clever though, and just aims his
> boat straight at the destination, of course the boat starts to get
> pushed off course by the river current, but the captain keeps the boat
> pointed at the destination at all times.  Eventually (assuming the boat
> can overcome the river current) the boat reaches the destination.  What
> shape curve did the boat trace out?
> 
> 

It would be some sheared tractrix (dog-curve), I presume.
(the shearing is due to the change of referential, as instead of the
target moving very slowly perpendicular to the boat direction, it's in
fact the boat which get drift away perpendicularly by the river)

Instead of a river, put the destination on a road, the boat on a lake,
and you get a tractrix.


Post a reply to this message

From: Kevin Wampler
Subject: Re: Boat/river puzzle
Date: 2 Dec 2010 04:11:09
Message: <4cf762ad$1@news.povray.org>
On 11/30/2010 8:31 AM, scott wrote:
> Maybe some of you remember the problem from basic vector math class,
> where a boat must travel across a flowing river to a certain point, and
> you need to calculate which direction the boat should point.
>
> The captain of a certain boat is not so clever though, and just aims his
> boat straight at the destination, of course the boat starts to get
> pushed off course by the river current, but the captain keeps the boat
> pointed at the destination at all times. Eventually (assuming the boat
> can overcome the river current) the boat reaches the destination. What
> shape curve did the boat trace out?
>

That's a surprisingly cute little puzzle, at least in the case where the 
speed of the current matches the speed of the boat and you can prove 
without any calculation that it follows a parabolic arc.  In general I 
think the curve is of the rather less elegant form x*sinh(v*log(x)+c) 
where x>=0, although it's possible I made a mistake somewhere.  Did you 
come up with this on your own or did you hear it elsewhere?


Post a reply to this message

From: Darren New
Subject: Re: Boat/river puzzle
Date: 2 Dec 2010 11:47:46
Message: <4cf7cdb2$1@news.povray.org>
Kevin Wampler wrote:
> speed of the current matches the speed of the boat 

I think that means you never get to where you're going. Once the current 
carries you downstream, if you can't outrun the current, you're not going to 
get upstream again.

-- 
Darren New, San Diego CA, USA (PST)
   Serving Suggestion:
     "Don't serve this any more. It's awful."


Post a reply to this message

From: Kevin Wampler
Subject: Re: Boat/river puzzle
Date: 2 Dec 2010 12:11:43
Message: <4cf7d34f$1@news.povray.org>
On 12/2/2010 8:47 AM, Darren New wrote:
> Kevin Wampler wrote:
>> speed of the current matches the speed of the boat
>
> I think that means you never get to where you're going. Once the current
> carries you downstream, if you can't outrun the current, you're not
> going to get upstream again.
>

Precisely, but you can still calculate the curve that the boat follows, 
and unless I'm mistaken it's a parabola (in this case restricted to x>0 
rather than x>=0).  It's not strictly within the parameters of the 
problem, but I mentioned it because I couldn't see how to derive the 
full answer without some calculus, but I could get an answer for that 
special case with just geometry.


Post a reply to this message

From: scott
Subject: Re: Boat/river puzzle
Date: 3 Dec 2010 03:56:18
Message: <4cf8b0b2@news.povray.org>
> That's a surprisingly cute little puzzle, at least in the case where the 
> speed of the current matches the speed of the boat and you can prove 
> without any calculation that it follows a parabolic arc.  In general I 
> think the curve is of the rather less elegant form x*sinh(v*log(x)+c) 
> where x>=0, although it's possible I made a mistake somewhere.

I started to try and figure it out using calculus but it all got too 
complicated when I tried to write the velocity in terms of the current 
position.  I kind of guessed intuitively it would be an interesting shape, I 
thought like half a water drop or something.

> Did you come up with this on your own or did you hear it elsewhere?

I came up with it on my own somehow, I don't recall how I got round to 
thinking about it!


Post a reply to this message

From: Kevin Wampler
Subject: Re: Boat/river puzzle
Date: 3 Dec 2010 18:32:18
Message: <4cf97e02$1@news.povray.org>
On 12/3/2010 12:56 AM, scott wrote:
>
> I started to try and figure it out using calculus but it all got too
> complicated when I tried to write the velocity in terms of the current
> position.

In that case I'll give some more info.  I was refraining from saying too 
much since I try to let the people who pose puzzles be the ones to talk 
about the answer.





[SPOILERS BELOW]





I started by normalizing everything by assuming that the target is at 
the origin, that the boat's speed is 1 and that the speed of the river 
is v in the y direction.  If you try to solve things the way you were 
going, you get the equation of motion:

-1/sqrt(x^2+y^2)*(x*dx/dt + y*(dy/dt - v)) = 1
subject to (dx/dt)^2 + (dy/dt - v)^2 = 1

After a bit of algebra you can simplify this to (I think, I didn't check 
my work):

v*x + y*dx/dt - x*dy/dt = 0

It's been a while since I've done any differential equations, so I 
didn't go this route.  Instead I eliminated the `t' variable and rewrote 
everything in terms of just the position of the boat (i.e. x and y).  In 
this view you get the differential equation:

dy/dx = y/x - v*sqrt(1+(y/x)^2)

Where the y/x term is the motion due to the motor of the boat and the 
-v*sqrt(1+(y/x)^2) term is due to the river's current.  As I said, it's 
been a while since I've done any differential equations, so I just 
plugged it into wolfram alpha and got the equation:

y = x*sinh(-v*log(x) + c)

Here v is the velocity of the current and c is a free parameter which 
you can use to adjust the initial position of the boat.  It also handles 
cases where |v|>= 1 and the boat can't ever reach the target perfectly well.

If you want to avoid using any calculus, it's easy to show that the boat 
moves in a parabola with the target at its focus when v=-1.  You can 
show this by using two (related) facts about parabolas:

1) A parabola is the set of points equidistant from a point at its focus 
and a horizontal line at its directrix.

2) A parabola reflects all vertical rays through its focus.

These two properties are best illustrated in this diagram:

http://upload.wikimedia.org/wikipedia/commons/9/97/Parabola_focus_directrix.svg

Here the (x,y) is the boat's position, the vector to the focus is 
parallel to the velocity due to the boat's motor, and the vector down to 
the directrix is parallel the velocity due to the current, and 
importantly is of equal length to the first vector, corresponding to the 
river's speed matching the boat's.  So you can see (and it's easy to 
prove) that if you sum these vectors you get a line parallel to the 
tangent of the parabola at the boat's position.  Thus the boat will move 
in a parabola with the target at its focus.  You can verify that if you 
plug v=-1 (or v=1) into x*sinh(-v*log(x)+c) you get a parabola with its 
focus at the origin.

I actually solved things this way (with a parabola and geometry) first, 
then used it as a model to write the differential equation which gives 
answers for when |v| != 1.


> I kind of guessed intuitively it would be an interesting
> shape, I thought like half a water drop or something.

It does looks sort of neat if you plot it for different values of v:

http://fooplot.com/index.php?&type0=0&type1=0&type2=0&type3=0&type4=0&y0=x*sinh%280.5*ln%28x%29%29&y1=x*sinh%280.8*ln%28x%29%29&y2=x*sinh%281.0*ln%28x%29%29&y3=x*sinh%281.1*ln%28x%29%29&y4=x*sinh%281.2*ln%28x%29%29&r0=&r1=&r2=&r3=&r4=&px0=&px1=&px2=&px3=&px4=&py0=&py1=&py2=&py3=&py4=&smin0=0&smin1=0&smin2=0&smin3=0&smin4=0&smax0=2pi&smax1=2pi&smax2=2pi&smax3=2pi&smax4=2pi&thetamin0=0&thetamin1=0&thetamin2=0&thetamin3=0&thetamin4=0&thetamax0=2pi&thetamax1=2pi&thetamax2=2pi&thetamax3=2pi&thetamax4=2pi&ipw=0&ixmin=-5&ixmax=5&iymin=-3&iymax=3&igx=0.1&igy=0.1&igl=0&igs=0&iax=1&ila=1&xmin=-0.47609860408646915&xmax=1.2753839171157066&ymin=-0.9772358187959684&ymax=0.056507871184616004


Post a reply to this message

From: scott
Subject: Re: Boat/river puzzle
Date: 7 Dec 2010 10:12:55
Message: <4cfe4ef7@news.povray.org>
> v*x + y*dx/dt - x*dy/dt = 0
>
> It's been a while since I've done any differential equations, so I didn't 
> go this route.  Instead I eliminated the `t' variable and rewrote 
> everything in terms of just the position of the boat (i.e. x and y).  In 
> this view you get the differential equation:
>
> dy/dx = y/x - v*sqrt(1+(y/x)^2)

That would have been the step I couldn't figure out - it's been a while 
since I did this type of thing regularly!


Post a reply to this message

From: Kevin Wampler
Subject: Re: Boat/river puzzle
Date: 7 Dec 2010 11:43:47
Message: <4cfe6443$1@news.povray.org>
On 12/7/2010 7:12 AM, scott wrote:
>
> That would have been the step I couldn't figure out - it's been a while
> since I did this type of thing regularly!
>

Understandable.  Still, it was a fun puzzle -- I'll remember it!


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.